tests/testthat/test-label-shadow.R

test_that("label_shadow returns character",{
  expect_type(label_shadow(airquality), "character")
})

test_that("label_shadow adds the right number of elements",{
  expect_equal(nrow(airquality), length(label_shadow(airquality)))
})

aq_shadow <- airquality %>% add_shadow(Ozone)

test_that("label_shadow contains 'Not Missing' and 'Missing'",{
  expect_equal(unique(label_shadow(aq_shadow)),
               c("Not Missing", "Missing"))
})

Try the naniar package in your browser

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

naniar documentation built on Feb. 16, 2023, 5:11 p.m.