Description Usage Arguments Value Examples
View source: R/HELPER_change_ts_object_seasonality.R
change_ts_object_seasonality
is a function to modify or add a
seasonality attribute to an existing time series object.
1 | change_ts_object_seasonality(ts_object, seasonality)
|
ts_object |
A time series object containing the values for the
column_of_interest, which has been created using the
|
seasonality |
A numerical vector indicating the seasonality to employ for the time series object, for example c(12, 3). |
A time series object with the specified seasonality.
1 2 3 4 5 6 7 8 9 10 | ts_object <- tstools::initialize_ts_forecast_data(
data = dummy_gasprice,
date_col = "year_month",
col_of_interest = "gasprice",
group_cols = c("state", "oil_company"),
xreg_cols = c("spotprice", "gemprice")
)%>%
dplyr::filter(grouping == "state = New York & oil_company = CompanyB") %>%
tstools::transform_data_to_ts_object(seasonal_periods = 1)
change_ts_object_seasonality(ts_object, seasonality = c(12, 3, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.