The "Reading coverage" sections of cog_peer_compare() and
cog_geographic_rollup() recommended comparing a census year with a sample
year. The published corpus shows those years collect different governments,
so they now give the vignette's advice: compare census years with each other,
or the same governments across years.
The FY2022 Georgia example called the year complete and the 174-city gap
"overwhelmingly" sheriff contracting, "not non-response". The counters show
32 cities not collected and 142 collected with no Police rows, and nothing
measures how many of the 142 contract. The reference pages and the vignette
now say that.
cog_find_peers() and cog_gov_search() pointed at vignette('coverage-scope'),
which does not exist. Both now state the scope, with tests.
Closes #78
Closes #79
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
8 files changed
+60
-34
No files matched your search
@@ -136,3 +136,10 @@ test_that("cog_peer_compare cohort_year is NA for bare character peers", {
|
||||
)
|
||||
expect_true(all(is.na(r$cohort_year)))
|
||||
})
|
||||
|
||||
test_that("cog_find_peers unknown-govid error states the scope without a dead link", {
|
||||
skip_if_no_corpus()
|
||||
err <- expect_error(cog_find_peers("000000000000"), "not found in corpus")
|
||||
expect_match(conditionMessage(err), "types 0-3")
|
||||
expect_no_match(conditionMessage(err), "coverage-scope|v0\\.1")
|
||||
})
|
||||
@@ -63,6 +63,13 @@ test_that("cog_gov_search sorts by population desc", {
|
||||
expect_true(all(diff(nonNA) <= 0))
|
||||
})
|
||||
|
||||
test_that("cog_gov_search excluded-type message states the scope without a dead link", {
|
||||
skip_if_no_corpus()
|
||||
msgs <- testthat::capture_messages(cog_gov_search(type = 4L))
|
||||
expect_match(paste(msgs, collapse = " "), "types 0-3")
|
||||
expect_no_match(paste(msgs, collapse = " "), "coverage-scope|v0\\.1")
|
||||
})
|
||||
|
||||
test_that("cog_gov_search rejects unknown type string", {
|
||||
expect_error(cog_gov_search(type = "galaxy"), "Unknown type")
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user