Description Usage Arguments Value Examples
Extract seasonality from numeric vector
1 2 3 | ## S3 method for class 'numeric'
extract_seasonality(.x, .freq = 12, .method = "stl",
.part = "seasonal")
|
.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" |
data frame with .part
parts of .method
decompositions
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.