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.
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. If NULL (default), the largest frequency in the data is used. If numeric, it represents the frequency times the interval between observations. If a string (e.g., "1y" for 1 year, "3m" for 3 months, "1d" for 1 day, "1h" for 1 hour, "1min" for 1 minute, "1s" for 1 second), it's converted to a Period class object from the lubridate package. Note that the data must have at least one observation per seasonal period, and the period cannot be smaller than the observation interval.
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 max_col
, the plot
will not include a colour. Use max_col = 0
to never colour the lines, or Inf
to always colour the lines. If labels are used, then max_col will be ignored.
The maximum number of colours to show using a discrete colour scale.
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.
If TRUE, the seasonal period identifying labels will be repelled with the ggrepel package.
Allows seasonal period identifying labels to be nudged to the left or right from their default position.
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/