tests/testthat/test-summarize_ndr.R

test_that("summarize_ndr works as planned", {
  expect_identical(
    {
      curr <- tx_curr(ndr_example)
      summarize_ndr(curr, level = "state", names = "tx_curr")
    },
    janitor::adorn_totals(dplyr::count(tx_curr(ndr_example), ip, state, name = "tx_curr"))
  )
})

Try the tidyndr package in your browser

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

tidyndr documentation built on April 8, 2022, 9:06 a.m.