tests/testthat/test-allna.R

if (require("testthat") && require("sjmisc")) {
  x <- c(NA, NA, NA)
  y <- c(1, NA, NA)

  test_that("all_na", {
    expect_true(all_na(x))
  })

  test_that("all_na", {
    expect_false(all_na(y))
  })

  test_that("all_na, data.frame", {
    expect_is(all_na(data.frame(x, y)), "data.frame")
  })
}
sjPlot/sjmisc documentation built on June 28, 2023, 2:39 p.m.