简体   繁体   中英

seasonal plot Error in data.frame(y = as.numeric(x)) arguments imply differing number of rows:

here is my Code:

    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")

but compiler show error

Error in data.frame(y = as.numeric(x), year = trunc(time(x)), cycle = as.numeric(cycle(x)), : arguments imply differing number of rows: 235, 47

y <- ts(briskaranged$GrandTotal, 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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM