View source: R/correlation_functions.R
| ts_decompose | R Documentation | 
Interactive visualization the trend, seasonal and random components of a time series based on the decompose function from the stats package.
ts_decompose(ts.obj, type = "additive", showline = TRUE)
| 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) | 
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.