I've been having some issues with the forecast
package, the autoplot()
function is not working properly for forecasted objects. Whenever I try setting parameters such as 'showgap = FALSE' it does not work and the gap keeps there. Yet, it's not plotting the prediction interval levels (80% and 95%). I tried loading only forecast
package and running the code, however, nothing seems to work. I'm sorry if that's a silly question, but I could not figure it out on my on. All other packages are working properly, ggplot2
itself has no problem at all when plotting there (using other arguments, etc.).
Can anyone explain what's going on and how could it be fixed.
library(forecast)
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
library(fpp2)
#> ── Attaching packages ────────────────────────────────────────────── fpp2 2.5 ──
#> ✔ ggplot2 3.5.0 ✔ expsmooth 2.3
#> ✔ fma 2.5
#>
library(fpp3)
#> ── Attaching packages ────────────────────────────────────────────── fpp3 0.5 ──
#> ✔ tibble 3.2.1 ✔ tsibbledata 0.4.1
#> ✔ dplyr 1.1.3 ✔ feasts 0.3.1
#> ✔ tidyr 1.3.0 ✔ fable 0.3.3
#> ✔ lubridate 1.9.2 ✔ fabletools 0.3.3
#> ✔ tsibble 1.1.3
#> ── Conflicts ───────────────────────────────────────────────── fpp3_conflicts ──
#> ✖ lubridate::date() masks base::date()
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ tsibble::intersect() masks base::intersect()
#> ✖ tsibble::interval() masks lubridate::interval()
#> ✖ dplyr::lag() masks stats::lag()
#> ✖ tsibble::setdiff() masks base::setdiff()
#> ✖ tsibble::union() masks base::union()
#>
#> Attaching package: 'fpp3'
#> The following object is masked from 'package:fpp2':
#>
#> insurance
a <- ts(c(115,93,85,47,72,88,91,111,175,189), start = 2015)
forecast.a <- forecast(a, h = 7, level = c(80,95))
autoplot(forecast.a, showgap = FALSE)
Created on 2024-03-31 with reprex v2.1.0
Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.3 (2024-02-29 ucrt)
#> os Windows 11 x64 (build 22631)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate Portuguese_Brazil.utf8
#> ctype Portuguese_Brazil.utf8
#> tz America/Fortaleza
#> date 2024-03-31
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)