I am using the fable package in R to forecast. I have successfully created forecasts for my units of interest (in this case metropolitan areas).
My issue is that, instead of using facet_wrap for autoplot, I want to generate forecast graphs for each metropolitan area (there are 64).
I tried the below code but got the associated error below.
forecastplots <- forecasts %>% group_by(Metro) %>% autoplot(fabledata)
Error in `hilo()`:
! Objects of type `grouped_ts` are not supported by `hilo()`, you can create a custom `hilo` with `new_hilo()`
• Objects of type `grouped_df` are not supported by `hilo()`, you can create a custom `hilo` with `new_hilo()`
• Objects of type `tbl_ts` are not supported by `hilo()`, you can create a custom `hilo` with `new_hilo()`
• Objects of type `tbl_df` are not supported by `hilo()`, you can create a custom `hilo` with `new_hilo()`
• Objects of type `tbl` are not supported by `hilo()`, you can create a custom `hilo` with `new_hilo()`
• Objects of type `data.frame` are not supported by `hilo()`, you can create a custom `hilo` with `new_hilo()`
Run `rlang::last_error()` to see where the error occurred.
I realize this is with groups and the hilo() function, but is there a workaround so I can generate all individual forecast graphs at once instead of having to type out each one with the filter == Metro command? I can do this but it will be time consuming and could also run into issues if my number of metros ever changes.
I may be missing something obvious with dplyr or fable but cannot figure it out.
I can generate the forecasts and the individual graphs but would like to be able to automatically generate all individual forecasts and be able to save these to an external pdf file.