我将R与Anaconda和Jupyter一起使用。我也在使用tidyverse库。
当我运行时:
days_label <- factor(df$days)
fct_recode(days_label,
'Mon;Tue;Wed;Thu;Fri;' = 1,
'Sat;' = 2,
'Sun;' = 3) 我得到一个错误,说R找不到fct_recode函数。我尝试过使用?tidyverse,我得到了这个函数的完整描述。
是R的安装有问题,还是我的代码有问题?
发布于 2017-10-14 05:24:21
试试forcats::fct_recode()
虽然不确定您的代码可以按原样工作,但请参阅?forcats::fct_recode()的示例:
fct_recode(x, fruit = "apple", fruit = "banana")https://stackoverflow.com/questions/46738171
复制相似问题