tests/testthat/test-na_count.R

test_that("na_count works", {
  na_data <- data.frame(c1 = c(1, NA), c2 = c(NA, NA))
  na_res <-
    na_data %>%
    na_count(sort = FALSE)
  expect_equivalent(na_res$na_count, c(1, 2))
  expect_equivalent(na_res$na_percent, c(50, 100))
})

Try the misc package in your browser

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

misc documentation built on April 8, 2026, 9:10 a.m.