autoplot.decomposed.ts

0th

Percentile

Plot time series decomposition components using ggplot

Produces a ggplot object of seasonally decomposed time series for objects of class “stl” (created with stl), class “seas” (created with seas), or class “decomposed.ts” (created with decompose).

Usage
# S3 method for decomposed.ts
autoplot(object, labels = NULL, range.bars = NULL,
  ...)

# S3 method for stl autoplot(object, labels = NULL, range.bars = TRUE, ...)

# S3 method for StructTS autoplot(object, labels = NULL, range.bars = TRUE, ...)

# S3 method for seas autoplot(object, labels = NULL, range.bars = NULL, ...)

Arguments
object

Object of class “seas”, “stl”, or “decomposed.ts”.

labels

Labels to replace “seasonal”, “trend”, and “remainder”.

range.bars

Logical indicating if each plot should have a bar at its right side representing relative size. If NULL, automatic selection takes place.

...

Other plotting parameters to affect the plot.

Value

Returns an object of class ggplot.

See Also

seas, stl, decompose, StructTS, plot.stl.

Aliases
  • autoplot.decomposed.ts
  • autoplot.stl
  • autoplot.StructTS
  • autoplot.seas
Examples
# NOT RUN {
library(ggplot2)
co2 %>% decompose %>% autoplot
nottem %>% stl(s.window='periodic') %>% autoplot

# }
# NOT RUN {
library(seasonal)
seas(USAccDeaths) %>% autoplot
# }
# NOT RUN {
# }
Documentation reproduced from package forecast, version 8.1, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.