test_that("epi shift single works, renames", {
tib <- tibble(
x = 1:5, y = 1:5,
time_value = seq(as.Date("2020-01-01"), by = 1, length.out = 5),
geo_value = "ca"
) %>% epiprocess::as_epi_df()
ess <- epi_shift_single(tib, "x", 1, "test", key_colnames(tib))
expect_named(ess, c("geo_value", "time_value", "test"))
expect_equal(ess$time_value, tib$time_value + 1)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.