Use autoplot() to visualize the time series
gold, woolyrnq, and gas. These
visualizations help analyze trends and seasonality.
library(fpp2)
## Warning: package 'fpp2' was built under R version 4.1.3
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
## -- Attaching packages ---------------------------------------------- fpp2 2.5 --
## v ggplot2 3.5.1 v fma 2.5
## v forecast 8.23.0 v expsmooth 2.3
## Warning: package 'fma' was built under R version 4.1.3
## Warning: package 'expsmooth' was built under R version 4.1.3
##
# Plot gold prices
autoplot(gold) + ggtitle("Gold Prices Over Time")
# Plot wool yarn production
autoplot(woolyrnq) + ggtitle("Wool Yarn Production Over Time")
# Plot gas production
autoplot(gas) + ggtitle("Gas Production Over Time")