sw_tidy_decomp: Coerces decomposed time-series objects to tibble format.

Description Usage Arguments Details Value Examples

View source: R/sw_tidy_decomp.R

Description

Coerces decomposed time-series objects to tibble format.

Usage

1
sw_tidy_decomp(x, timetk_idx = FALSE, rename_index = "index", ...)

Arguments

x

A time-series object of class stl, ets, decomposed.ts, HoltWinters, bats or tbats.

timetk_idx

When TRUE, uses a timetk index (irregular, typically date or datetime) if present.

rename_index

Enables the index column to be renamed.

...

Not used.

Details

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.

Value

Returns a tibble object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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()

sweep documentation built on July 10, 2020, 5:13 p.m.