tests/testthat/test-missing.R

context("missing")

test_that("missing", {
  data <- data.frame(x = 1, y = 2, z = 0)
  expect_identical(check_missing_colnames(data, "a"), data)
  expect_error(check_missing_colnames(data, c("y", "x", "a")), "data must not have columns 'x' and 'y'")
})
  

Try the checkr package in your browser

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

checkr documentation built on May 1, 2019, 6:59 p.m.