我一直在使用dplyr::recode()函数对一些变量进行重新编码。我有一个字符变量和一些空字符串,我也想重新编码。但是,如果我引用函数的参数中的空字符串,就会得到一个错误。recode(x, "a"="Apple", "b"="Banana", ""="Missing")
Error: attempt to u
我正在尝试将一个字符变量重新编码为一个数值。字符变量如下所示:
b <- c("Your category choice is correct", "Your category choice is incorrect", ...我试图将"Your category choice is correct"编码为1,将"Your category choice is incorrect"<e
我想知道如何以某种方式将列播放器名称中的字符串存储到变量或数据库中。
之所以出现这种情况,是因为代码中有一个名为$player的变量。此变量每24小时存储一个不同的字符串,并打印到我的站点上。我想编码那个if '$player' is equal to any string in the column 'Player Name' from goal.com,重新运行这个函数,以便一个不同的字符串