ts_decompose: Visualization of the Decompose of a Time Series Object

View source: R/correlation_functions.R

ts_decomposeR Documentation

Visualization of the Decompose of a Time Series Object

Description

Interactive visualization the trend, seasonal and random components of a time series based on the decompose function from the stats package.

Usage

ts_decompose(ts.obj, type = "additive", showline = TRUE)

Arguments

ts.obj

a univariate time series object of a class "ts", "zoo" or "xts"

type

Set the type of the seasonal component, can be set to either "additive", "multiplicative" or "both" to compare between the first two options (default set to “additive”)

showline

Logic, add a separation line between each of the plot components (default set to TRUE)

Examples

# Defualt decompose plot
ts_decompose(AirPassengers)

# Remove the sepration lines between the plot components
ts_decompose(AirPassengers, showline = FALSE)

# Plot side by side a decompose of additive and multiplicative series
ts_decompose(AirPassengers, type = "both")


TSstudio documentation built on Aug. 9, 2023, 9:06 a.m.