【发布时间】:2020-12-24 17:38:27
【问题描述】:
我正在尝试将数据集中的性别变量更改为字符变量(即 1 = 男性、2 = 女性、3 = 其他)
我尝试运行的代码如下
bwdata6 <- bwdata6 %>% mutate(across(c(Gender),
~recode(.x, ‘1’ = male, ‘2’ = female, ‘3’ = other)))
我得到的错误信息如下。
Error: Problem with mutate() input ..1.
x object ‘male’ not found
i Input ..1 is across(c(Gender), ~recode(.x, 1= male,2= female,3 = other)).
这里出了什么问题?任何想法如何解决这个问题?
【问题讨论】: