tests/testthat/test-geoid.R

test_that('breakdown_geoid', {
  ex <- mt_county %>% breakdown_geoid()
  expect_true(all(c('state', 'county') %in% names(ex)))
})


test_that('construct_geoid', {
  ex <- mt_county %>%
    breakdown_geoid() %>%
    construct_geoid()
  expect_true(all(c('state', 'county') %in% names(ex)))
  expect_identical(ex$GEOID, mt_county$GEOID)
})

Try the censable package in your browser

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

censable documentation built on Nov. 20, 2022, 1:06 a.m.