数据data里面的date想加上星期几,用data美元符号dow<-as.factor(weekdays(data美元符号date))提示
Error in UseMethod("weekdays") :
no applicable method for 'weekdays' applied to an object of class "factor"
怎么回事呢?
用data美元符号month<-as.factor(months(data美元符号date))也提示
Error in UseMethod("months") :
no applicable method for 'months' applied to an object of class "factor"
date
2015/12/1
2015/12/10
2015/12/11
2015/12/12
2015/12/13
2015/12/14
johnmy 发表于 2016-9-24 18:13
give som reproduciabe codes
data$dow<-as.factor(weekdays(data$date))
我想给日期加上星期几就
出现了下面的提示
Error in UseMethod("weekdays") :
no applicable method for 'weekdays' applied to an object of class "factor"