【发布时间】:2011-03-27 08:40:06
【问题描述】:
我正在尝试将字符变量重新编码为数值。
字符变量如下所示:
b <- c("Your category choice is correct", "Your category choice is incorrect", ...
我尝试了以下方法:
b_recoded <- ifelse(b = "Your category choice is correct",
c(1), c(0))
我收到以下错误:
未使用的参数(b =“您的类别选择是正确的”)
我怎样才能让它工作?我正在尝试将"Your category choice is correct" 编码为1 和"Your category choice is incorrect" 编码为0。
对不起,基本问题。我还在学习。
【问题讨论】:
标签: r