Description Usage Arguments Value Examples
View source: R/HELPER_sum_ts_objects.R
sum_ts_objects
is a function to sum two separate time series object to
get a single ts object.
1 | sum_ts_objects(ts_objects, new_grouping = "")
|
ts_objects |
A list of time series object to be summed. |
new_grouping |
A character vector containing the grouping of the newly created time series object. |
A summed time series object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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)
sum_ts_objects(
ts_objects = list(
ts_object,
ts_object,
ts_object
),
new_grouping = "state = Trice New York & oil_company = Trice CompanyA"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.