标签: r mutate
如何使用mapvalues()函数执行以下操作(将整数变量转换为因子变量)?
library(MASS) data(birthwt) birthwt<-birthwt %>% mutate(low=as.factor(low),race=as.factor(race),smoke=as.factor(smoke),ptl=as.factor(ptl),ht=as.factor(ht),ui=as.factor(ui),ftv=as.factor(ftv))