【发布时间】:2019-08-23 08:40:24
【问题描述】:
我有以下数据
data_sample
date Sum
1 Feb 2015 3322.01
2 Mar 2015 6652.77
3 Apr 2015 3311.12
etc
我需要转换为时间序列进行预测
> data <- xts(data_sample[,-1], order.by=as.Date(data_sample[,1], "%Y %m"))
Error in 1 - frac : non-numeric argument to binary operator
> data <- xts(data_sample[,-1], order.by=as.Date(data_sample[,1], "%m %Y"))
Error in 1 - frac : non-numeric argument to binary operator
> ts_ts(ts_long(data_sample))
Error in guess_time(x) :
No [time] column detected. To be explict, name time column as 'time'.
【问题讨论】:
标签: r time-series