Produces a time series seasonal plot. A seasonal plot is similar to a regular time series plot, except the x-axis shows data from within each season. This plot type allows the underlying seasonal pattern to be seen more clearly, and is especially useful in identifying years in which the pattern changes.
gg_season( data, y = NULL, period = NULL, facet_period = NULL, max_col = 15, pal = (scales::hue_pal())(9), polar = FALSE, labels = c("none", "left", "right", "both"), ... )
A tidy time series object (tsibble)
The variable to plot (a bare expression). If NULL, it will automatically selected from the data.
The seasonal period to display.
A secondary seasonal period to facet by (typically smaller than period).
The maximum number of colours to display on the plot. If the
number of seasonal periods in the data is larger than
A colour palette to be used.
If TRUE, the season plot will be shown on polar coordinates.
Position of the labels for seasonal period identifier.
Additional arguments passed to geom_line()
A ggplot object showing a seasonal plot of a time series.
Hyndman and Athanasopoulos (2019) Forecasting: principles and practice, 3rd edition, OTexts: Melbourne, Australia. https://OTexts.com/fpp3/
library(tsibble) library(dplyr) tsibbledata::aus_retail %>% filter( State == "Victoria", Industry == "Cafes, restaurants and catering services" ) %>% gg_season(Turnover)