Nothing
test_that("can shift in either direction", {
f1 <- factor(c("a", "b", "c"))
f2_l <- fct_shift(f1, 1)
expect_equal(levels(f2_l), c("b", "c", "a"))
f2_r <- fct_shift(f1, -1)
expect_equal(levels(f2_r), c("c", "a", "b"))
})
test_that("0 shift leaves unchanged", {
f1 <- factor(c("a", "b", "c"))
f2 <- fct_shift(f1, 0)
expect_identical(f1, f2)
})
test_that("validates its inputs", {
expect_snapshot(error = TRUE, {
fct_shift(1)
fct_shift("x", NA)
})
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.