Trying to run the example in Section 9.7 of fpp3 I get the error message below:
-The script is run with only fpp3 library loaded
- I am using R 4.4.1 (note that some packages loaded by fpp3 are built with R 4.4.3)
- I get the same error with my personal scripts while attempting to use autoplot with forecast objects.
-The problem should be related to update of the R system or its library, because with my previous installation both fpp3 examples and my scripts were working with no problem. Unfortunately I have no recollection of the library versions in my previous installation, which anyway should have been based on R 3.6|
I attach the full R code, which anyway is just copied from online version of fpp3:
R code
library(fpp3)
global_economy |>
filter(Code == "CAF") |>
gg_tsdisplay(difference(Exports), plot_type='partial')
augment(caf_fit) |>
filter(.model=='search') |>
features(.innov, ljung_box, lag = 10, dof = 3)
caf_fit <- global_economy |>
filter(Code == "CAF") |>
model(arima210 = ARIMA(Exports ~ pdq(2,1,0)),
arima013 = ARIMA(Exports ~ pdq(0,1,3)),
stepwise = ARIMA(Exports),
search = ARIMA(Exports, stepwise=FALSE))
caf_fit |>
select(search) |>
gg_tsresiduals()
augment(caf_fit) |>
filter(.model=='search') |>
features(.innov, ljung_box, lag = 10, dof = 3)
caf_fit |>
forecast(h=5) |>
filter(.model=='search') |>
autoplot(global_economy)
