tests/testthat/test-load_composite_imd.R

test_that("data loads", {
  imd_uk <- load_composite_imd()

  expect_equal(nrow(imd_uk), 42619)
})

test_that("error thrown", {
  expect_error(load_composite_imd("Z"), "Invalid nation: it must be one of 'E', 'W', 'S', 'N'")
})

Try the IMD package in your browser

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

IMD documentation built on Sept. 30, 2022, 5:06 p.m.