ts_transform: Black box function to prepare time series

ts_transformR Documentation

Black box function to prepare time series

Description

This function performs a number of conditional treatments (see arguments) commonly useful for use in time series forecasting models.

Usage

ts_transform(
  data,
  y,
  stationary = TRUE,
  lags = 1:4,
  fill_down_na = TRUE,
  seasonal_dummies = TRUE
)

Arguments

data

A tsibble object

y

Column name of the variable of interest

stationary

If TRUE, use report_ndiffs() to differentiate series

lags

Numeric vector indicating how many lags should be used to expand the data.

fill_down_na

If TRUE, fill NA observations with the last observed value downwards.

seasonal_dummies

If TRUE, add seasonal dummies to the data.

Value

A tsibble

Examples

df_macro <- get_data(quiet = TRUE)
df_macro_augmented <- ts_transform(df_macro, "ipca")

schoulten/ipca documentation built on May 27, 2022, 10:05 p.m.