plot.decomposition {VisitorCounts} | R Documentation |
Decomposition Plot Methods
Description
Methods for plotting objects of the class "decomposition".
Usage
## S3 method for class 'decomposition'
plot(x, type = c("full", "period", "classical"), legend = TRUE, ...)
Arguments
x |
An object of class "decomposition". |
type |
A character string. One of "full","period", or "classical". If "full", the full reconstruction is plotted. If "period", the reconstruction of each period is plotted individually. If "classical", the trend and seasonality are plotted. |
legend |
A Boolean specifying whether a legend should be added when type is "full". The default option is TRUE. |
... |
Additional arguments. |
Value
A plot of the reconstruction in the "decomposition" class object.
Examples
data("park_visitation")
park <- "YELL"
nps_ts <- ts(park_visitation[park_visitation$park == park,]$nps, start = 2005, frequency = 12)
nps_ts <- log(nps_ts)
pud_ts <- ts(park_visitation[park_visitation$park == park,]$pud, start = 2005, frequency = 12)
pud_ts <- log(pud_ts)
nps_ts <- ts(park_visitation[park_visitation$park == park,]$nps, start = 2005, frequency = 12)
nps_ts <- log(nps_ts)
decomposition_pud <- auto_decompose(pud_ts)
decomposition_nps <- auto_decompose(nps_ts)
plot(decomposition_pud,lwd = 2)
plot(decomposition_pud,type = "period")
plot(decomposition_pud,type = "classical")
plot(decomposition_nps,legend = TRUE)
plot(decomposition_nps,type = "period")
plot(decomposition_nps,type = "classical")
[Package VisitorCounts version 2.0.0 Index]