tests/testthat/test-withdrawal_pre_post.R

test_that("number rows & columns correct", {
  expect_equal(
    dim(withdrawal_pre_post),
    c(4805L, 4L)
  )
})

test_that("variable names correct", {
  expect_equal(
    names(withdrawal_pre_post),
    c("who", "what", "withdrawal", "when")
  )
})

test_that("variable class correct", {
  expect_equal(
    sapply(withdrawal_pre_post, class),
    c(who = "integer", what = "factor", withdrawal = "factor", when = "numeric")
  )
})

Try the public.ctn0094data package in your browser

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

public.ctn0094data documentation built on Oct. 1, 2023, 5:08 p.m.