【发布时间】:2019-01-26 06:20:02
【问题描述】:
这是我的代码:
month year GrandTotal Date
1 6 2014 15172331 2014-06-30
2 7 2014 24381383 2014-07-31
3 8 2014 24351338 2014-08-31
...
46 3 2018 85980914 2018-03-31
47 4 2018 72723488 2018-04-30
y <- ts(briskaranged, start=2014, frequency=12)
library(ggplot2)
#ploting of variables
autoplot(y) +
labs(x ="Date", y = "GrandTotal", title = "Amount, ggplot2")
#seasonalplot
ggseasonplot(y, year.labels=TRUE, year.labels.left=TRUE) +
ylab("amount") +
ggtitle("Seasonal plot: amount transaction per day")
但编译器显示错误
data.frame 中的错误(y = as.numeric(x),year = trunc(time(x)),cycle = as.numeric(循环(x)),: 参数意味着不同的行数:235、47
【问题讨论】:
-
最好逐行运行,找出第一次出现此错误的时间。从您的帖子中,尚不清楚何时会这样做。您还可以使用
dput提供briksaranged的样本吗?也许运行traceback电话?您能否将您的ts命名为其他名称而不是y?
标签: r ggplot2 time-series