extract_seasonality.numeric: Extract Seasonality from Vector

Description Usage Arguments Value Examples

Description

Extract seasonality from numeric vector

Usage

1
2
3
## S3 method for class 'numeric'
extract_seasonality(.x, .freq = 12, .method = "stl",
  .part = "seasonal")

Arguments

.x

numeric vector

.freq

frequency for time series

.method

method/methods to extract seasonality; could be "stl" (default), "additive", "multiplicative"

.part

parts of decomposition to keep: "seasonal" (default), "trend", "remainder"

Value

data frame with .part parts of .method decompositions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- rep(c(1:6, 6:1), 10)
seasonalities <- extract_seasonality(x, .freq = 12, .method = c("stl", "additive"))
head(seasonalities)
#>   stl_seasonal additive_seasonal
#>          <dbl>             <dbl>
#> 1       -2.5              -2.50 
#> 2       -1.5              -1.5  
#> 3       -0.5              -0.5  
#> 4        0.500             0.500
#> 5        1.50              1.50 
#> 6        2.50              2.5 

pavel-filatov/featr documentation built on May 12, 2019, 1:29 a.m.