context("test-keep_one")
ds <-
mtcars %>%
tibble::rownames_to_column("model") %>%
dplyr::select(cyl, mpg, model)
v_test_out <- ds %>% keep_one(cyl) %>% dplyr::pull(model)
test_that("multiplication works", {
expect_equal(v_test_out, c("Merc 230", "Valiant", "Hornet Sportabout"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.