【发布时间】:2019-01-04 12:59:51
【问题描述】:
我必须做一个 if 语句,但它说错误。我有一个名为cancercode 的变量。我希望不等于下面所述代码的代码在数据框中声明为“其他”。
df6 <- df4x%>%
mutate(sygdomsgruppex = ifelse(cancercode != "DC911", "DC833", "DC830",
"DC910", "DC921", "DC831", "DC859","DC919", "DC911B",
"Other", cancercode))
这段代码给了我这个错误:
mutate_impl(.data, dots) 中的错误:
评估错误:未使用的参数(“DC910”、“DC921”、“DC831”、“DC859”、“DC919”、“DC911B”、“其他”、cancerKode)。
【问题讨论】:
标签: r if-statement dplyr