-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathgg_tsdisplay.Rd
58 lines (54 loc) · 1.69 KB
/
gg_tsdisplay.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/graphics.R
\name{gg_tsdisplay}
\alias{gg_tsdisplay}
\title{Ensemble of time series displays}
\usage{
gg_tsdisplay(
data,
y = NULL,
plot_type = c("auto", "partial", "season", "histogram", "scatter", "spectrum"),
lag_max = NULL
)
}
\arguments{
\item{data}{A tidy time series object (tsibble)}
\item{y}{The variable to plot (a bare expression). If NULL, it will
automatically selected from the data.}
\item{plot_type}{type of plot to include in lower right corner. By default
(\code{"auto"}) a season plot will be shown for seasonal data, a spectrum plot
will be shown for non-seasonal data without missing values, and a PACF will
be shown otherwise.}
\item{lag_max}{maximum lag at which to calculate the acf. Default is 10*log10(N/m)
where N is the number of observations and m the number of series. Will be
automatically limited to one less than the number of observations in the series.}
}
\value{
A list of ggplot objects showing useful plots of a time series.
}
\description{
Plots a time series along with its ACF along with an customisable third
graphic of either a PACF, histogram, lagged scatterplot or spectral density.
}
\examples{
library(tsibble)
library(dplyr)
tsibbledata::aus_retail \%>\%
filter(
State == "Victoria",
Industry == "Cafes, restaurants and catering services"
) \%>\%
gg_tsdisplay(Turnover)
}
\references{
Hyndman and Athanasopoulos (2019) \emph{Forecasting: principles
and practice}, 3rd edition, OTexts: Melbourne, Australia.
\url{https://OTexts.com/fpp3/}
}
\seealso{
\code{\link[stats]{plot.ts}}, \code{\link{ACF}},
\code{\link[stats]{spec.ar}}
}
\author{
Rob J Hyndman & Mitchell O'Hara-Wild
}