ts_object_to_periods: Gets available periods from time series object

Description Usage Arguments Value Examples

View source: R/HELPER_ts_object_to_periods.R

Description

ts_object_to_periods is a function to transform a given time series object into a vector of periods in yyyymm numeric format.

Usage

1

Arguments

ts_object

A time series object.

Value

A vector of periods in yyyymm numeric format.

Examples

 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 = CompanyA") %>% 
   tstools::transform_data_to_ts_object(seasonal_periods = 3)
ts_object_to_periods(ts_object)

ing-bank/tsforecast documentation built on Sept. 18, 2020, 9:40 a.m.