test_that("select_variable", {
expect_identical(ps_select_variable(data.frame()), data.frame())
expect_identical(ps_select_variable(tibble::tibble()), tibble::tibble())
expect_identical(ps_select_variable(data.frame(x = 1)), data.frame(x = 1))
expect_identical(ps_select_variable(tibble::tibble(x = 1)), tibble::tibble(x = 1))
expect_identical(ps_select_variable(data.frame(x = c(1, NA))), data.frame(x = c(1, NA)))
expect_identical(ps_select_variable(tibble::tibble(x = c(1, NA))), tibble::tibble(x = c(1, NA)))
expect_identical(ps_select_variable(data.frame(x = c(1, NA)), na_ignore = TRUE), data.frame())
expect_identical(ps_select_variable(tibble::tibble(x = c(1, NA)), na_ignore = TRUE), tibble::tibble())
expect_identical(ps_select_variable(data.frame(x = c(1, NA), y = c(2, 2)), na_ignore = TRUE), data.frame())
expect_identical(ps_select_variable(tibble::tibble(x = c(1, NA), y = c(2, 2)), na_ignore = TRUE), tibble::tibble())
expect_identical(ps_select_variable(data.frame(x = c(1, NA), y = c(2, 1)), na_ignore = TRUE), data.frame(y = c(2, 1)))
expect_identical(ps_select_variable(tibble::tibble(x = c(1, NA), y = c(2, 1)), na_ignore = TRUE), tibble::tibble(y = c(2, 1)))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.