View source: R/sw_tidy_decomp.R
sw_tidy_decomp | R Documentation |
Coerces decomposed time-series objects to tibble format.
sw_tidy_decomp(x, timetk_idx = FALSE, rename_index = "index", ...)
x |
A time-series object of class |
timetk_idx |
When |
rename_index |
Enables the index column to be renamed. |
... |
Not used. |
sw_tidy_decomp
is designed
to coerce time-series objects with decompositions to tibble
objects.
A regularized time index is always constructed. If no time index is
detected, a sequential index is returned as a default.
The index column name can be changed using the rename_index
argument.
Returns a tibble
object.
library(dplyr)
library(forecast)
library(sweep)
# Decompose ETS model
USAccDeaths %>%
ets() %>%
sw_tidy_decomp()
# Decompose STL object
USAccDeaths %>%
stl(s.window = 'periodic') %>%
sw_tidy_decomp()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.