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 Sept. 2, 2025, 1:09 a.m.