You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was hoping you could remove the numeric check in the lag_vec() function. I'd like to use lag_vec() within tk_augment_lags() to create lag variables for things like holidays, which are character/factor values. This will help in leveraging lags/leads in time series machine learning models with non-numeric regressors.
I've checked that the xts::lag.xts() function works as intended with non-numeric data. Please see the code below.
Numeric Value timetk::m4_monthly %>% dplyr::group_by(id) %>% dplyr::mutate(lag_1 = lag_vec(value, lag = 3))
Factor/Character Value timetk::m4_monthly %>% dplyr::group_by(id) %>% dplyr::mutate(id = as.character(id), lag_1 = xts::lag.xts(x = id, k = 3, na.pad = TRUE))
Please let me know what you think. Thank you!
The text was updated successfully, but these errors were encountered:
Hey Matt and team,
I was hoping you could remove the numeric check in the lag_vec() function. I'd like to use lag_vec() within tk_augment_lags() to create lag variables for things like holidays, which are character/factor values. This will help in leveraging lags/leads in time series machine learning models with non-numeric regressors.
I've checked that the xts::lag.xts() function works as intended with non-numeric data. Please see the code below.
Numeric Value
timetk::m4_monthly %>% dplyr::group_by(id) %>% dplyr::mutate(lag_1 = lag_vec(value, lag = 3))
Factor/Character Value
timetk::m4_monthly %>% dplyr::group_by(id) %>% dplyr::mutate(id = as.character(id), lag_1 = xts::lag.xts(x = id, k = 3, na.pad = TRUE))
Please let me know what you think. Thank you!
The text was updated successfully, but these errors were encountered: