Closed spsanderson closed 1 week ago
Currently ts_vva_plt() has the following code:
ts_vva_plt()
data_diff_tbl <- data_tbl %>% timetk::tk_augment_differences(.value = {{value_col_var_expr}}, .differences = 1) %>% timetk::tk_augment_differences(.value = {{value_col_var_expr}}, .differences = 2) %>%
It needs to be as follows:
data_diff_tbl <- data_tbl |> timetk::tk_augment_differences(.value = {{value_col_var_expr}}, .lags = c(1, 2)) |> dplyr::rename(velocity = dplyr::contains("_lag1")) |> dplyr::rename(acceleration = dplyr::contains("_lag2")) |> tidyr::pivot_longer(-{{date_col_var_expr}}) |> dplyr::mutate(name = stringr::str_to_title(name)) |> dplyr::mutate(name = forcats::as_factor(name))
Currently
ts_vva_plt()
has the following code:It needs to be as follows: