get_actuals_from_main_forecasting_table: Get actuals from main_forecasting_table.

Description Usage Arguments Value Examples

View source: R/HELPER_get_actuals_from_main_forecasting_table.R

Description

get_actuals_from_main_forecasting_table is a function to extract the actuals from the main forecasting table, e.g. to be used for plotting.

Usage

1
get_actuals_from_main_forecasting_table(main_forecasting_table, for_plot = F)

Arguments

main_forecasting_table

A tibble containing several columns of data required for time series forecasting, which has been created using the create_main_forecasting_table function.

for_plot

Boolean, which is to be set to TRUE if specific transformations should be performed to make the data ready for one of the plotting functions available within the package, or set to FALSE if these additional transformation should not be applied.

Value

A tibble containing the actual values of the column of interest per period.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
main_forecasting_table <- tstools::initialize_ts_forecast_data(
      data = dummy_gasprice,
      date_col = "year_month",
      col_of_interest = "gasprice",
      group_cols = c("state", "oil_company")
   ) %>%
   create_main_forecasting_table(
      data = data,
      seasonal_periods = c(12,3)
   )
get_actuals_from_main_forecasting_table(main_forecasting_table)

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