Open dsweber2 opened 3 days ago
The motivating case is this outdated snippet from step_epi_slide, yoinked from https://github.com/cmu-delphi/epipredict/pull/387
step_epi_slide
tt_week <- seq(as.Date("2022-01-01"), by = "1 week", length.out = 20) edf_weekly <- data.frame( time_value = c(tt_week, tt_week), geo_value = rep(c("ca", "ny"), each = 20L), value = c(2:21, 3:22) ) %>% as_epi_df() test_that("epi_slide works on weekly data with one of before/ahead set", { expect_no_error( baked <- epi_recipe(edf_weekly) %>% step_epi_slide(value, .f = "mean", before = as.difftime(3, units = "weeks")) %>% prep(edf_weekly) %>% bake(new_data = NULL) ) attributes(baked)$metadata$as_of <- as.Date("1999-09-09") expect_snapshot(baked) })
The motivating case is this outdated snippet from
step_epi_slide
, yoinked from https://github.com/cmu-delphi/epipredict/pull/387