R: Tidying methods for decomposed time series

tidiers_decomposed_ts {sweep} | R Documentation

## Tidying methods for decomposed time series

### Description

Tidying methods for decomposed time series

### Usage

    ## S3 method for class 'decomposed.ts'
    sw_tidy_decomp(x, timetk_idx = FALSE, rename_index = "index", ...)

### Arguments

`x` | An object of class "decomposed.ts"
`timetk_idx` | Used with `sw_augment` and `sw_tidy_decomp`. When `TRUE`, uses a timetk index (irregular, typically date or datetime) if present.
`rename_index` | Used with `sw_augment` and `sw_tidy_decomp`. A string representing the name of the index generated.
`...` | Not used.

### Value

`sw_tidy_decomp()` returns a tibble with the following time series attributes:

- `index`: An index is either attempted to be extracted from the model or a sequential index is created for plotting purposes

- `season`: The seasonal component

- `trend`: The trend component

- `random`: The error component

- `seasadj`: observed - season

### See Also

`decompose()`

### Examples

    library(dplyr)
    library(forecast)
    library(sweep)

    fit_decomposed <- USAccDeaths %>%
        decompose()

    sw_tidy_decomp(fit_decomposed)

[Package sweep version 0.2.3 Index]