Nothing
test_that("works with character", {
vec <- c("a", "b", "c", "d")
res <- case_match(vec,
c("a", "b") ~ "A",
"c" ~ "B")
expect_equal(res, c("A", "A", "B", NA))
})
test_that("works with numeric & .default", {
vec <- 1:4
res <- case_match(vec,
c(1, 2) ~ 1,
3 ~ 2,
.default = 3)
expect_equal(res, c(1, 1, 2, 3))
})
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.