feat: refuse expenditure_concept = total in the cross-government verbs

Owner ruling R1. Combining Census Total across governments counts
intergovernmental transfers twice, and these results land in Tableau where a
warning would be invisible -- so this is a hard error whose message names the
fix and the reason.
This commit is contained in:
2026-07-27 10:14:16 -04:00
parent e2088458e1
commit 81fd1a5279
6 changed files with 95 additions and 4 deletions
+9 -1
View File
@@ -9,7 +9,8 @@ cog_geographic_rollup(
category,
years,
per_capita = FALSE,
adjust_to_year = NULL
adjust_to_year = NULL,
expenditure_concept = c("direct", "total")
)
}
\arguments{
@@ -27,6 +28,13 @@ population from `gov_population_yearly`. Govs with missing population
are excluded from the result.}
\item{adjust_to_year}{Integer base year for CPI-U conversion, or `NULL`.}
\item{expenditure_concept}{`"direct"` (default) or `"total"`. Currently only
`"direct"` is accepted; the `"total"` option exists in [cog_spending()] for
single-government queries but cannot be used here because combining Total
across multiple layers of government double-counts intergovernmental
transfers (a state's payment to a school district is the same dollar the
district reports as its own Direct spending).}
}
\value{
Tibble with columns `year`, `layer`, `canonical_govid`, `gov_name`,
+7 -1
View File
@@ -10,7 +10,8 @@ cog_peer_compare(
category,
years,
per_capita = TRUE,
adjust_to_year = NULL
adjust_to_year = NULL,
expenditure_concept = c("direct", "total")
)
}
\arguments{
@@ -27,6 +28,11 @@ cog_peer_compare(
population.}
\item{adjust_to_year}{Integer base year for CPI-U conversion or `NULL`.}
\item{expenditure_concept}{`"direct"` (default) or `"total"`. Currently only
`"direct"` is accepted; the `"total"` option exists in [cog_spending()] for
single-government queries but cannot be used here because combining Total
across peer sets counts intergovernmental transfers twice.}
}
\value{
Tibble matching [cog_spending()]'s columns, plus a `role`