A lag plot shows the time series against lags of itself. It is often coloured the seasonal period to identify how each season correlates with others.
gg_lag(data, y = NULL, period = NULL, lags = 1:9, geom = c("path", "point"), ...)
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 vector of lags to display as facets.
The geometry used to display the data.
Additional arguments passed to the geom.
A ggplot object showing a lag plot of a time series.
library(tsibble) library(dplyr) tsibbledata::aus_retail %>% filter( State == "Victoria", Industry == "Cafes, restaurants and catering services" ) %>% gg_lag(Turnover)