我想根据特定名称的给定变量值将NA
转换为特定字符。示例查询
df1 = data.frame(session=c("breakfast","breakfast", "breakfast", "NA","lunch","lunch","lunch","NA","dinner","dinner","dinner","NA"))
在哪里需要这样的结果
df2 = data.frame(session=c("breakfast","breakfast", "breakfast", "breakfast Total","lunch","lunch","lunch","lunch Total","dinner","dinner","dinner","dinner Total"))