求高手:换时间标度的时候总是出错
r语言吧
全部回复
仅看楼主
level 1
somaniya 楼主
plot<-qplot(datap$times,datap$REER)
plot+scale_x_date(breaks=date_breaks("1 year"))
错误: Invalid input: date_trans works with objects of class Date only
2015年04月19日 03点04分 1
level 5
首先,应该把times变量转换成Date类型
作图根据ggplot2的文档,应该这么写:
plot+scale_x_date(date_breaks = "1 year")
2016年10月20日 04点10分 3
1