tests/testthat/test-missingindicator.R

test_that("missingindicator appends logical indicator columns", {
  data <- data.frame(
    id = c(1, 2, 3),
    value = c("a", NA, " ")
  )

  out <- missingindicator(data, cols = "value")

  expect_s3_class(out, "basetable")
  expect_true("missing_value" %in% names(out))
  expect_equal(out$missing_value, c(FALSE, TRUE, TRUE))
})

Try the basetable package in your browser

Any scripts or data that you put into this service are public.

basetable documentation built on Sept. 18, 2026, 9:13 a.m.