autoplot problems

good day.
was trying to construct a time series plot and I get this error when using the autoplot command:
could not find function "autoplot"
Please help

You probably have to install a package such as fable, which is one of the many time series packages.

Hi, and welcome.

You'll find this in the forecast package..

install.packages("forecast","fpp")
library(forecast)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
library(fpp)
#> Loading required package: fma
#> Loading required package: expsmooth
#> Loading required package: lmtest
#> Loading required package: zoo
#> 
#> Attaching package: 'zoo'
#> The following objects are masked from 'package:base':
#> 
#>     as.Date, as.Date.numeric
#> Loading required package: tseries
data(ausbeer)
fcast <- forecast(ausbeer, h = 4)
autoplot(fcast)

Created on 2020-02-18 by the reprex package (v0.3.0)

The autoplot() function is from the ggplot2 package. You will need to load ggplot2 first using library(ggplot2), and have the appropriate extension library (likely fable) installed on your computer for autoplot() to work.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.