I am following Rob Hyndman forecasting book and I can not use autoplot
even in this simple example, extracted from the book:
library(ggplot2)
library(tsibble)
y <- tsibble(Year = 2015:2019,
Observation = c(123,39,78,52,110),
index = Year)
autoplot(y)
I got the following error: Error: Objects of type tbl_ts/tbl_df/tbl/data.frame not supported by autoplot
.
I have for sure that y is a tsibble
:
y
# A tsibble: 5 x 2 [1Y]
Year Observation
<int> <dbl>
1 2015 123
2 2016 39
3 2017 78
4 2018 52
5 2019 110