feat: expenditure_concept = direct|total in cog_spending()

total adds an intergovernmental leg (M = to local, L = to state) as a UNION ALL
over new ig_annotated views. The IG leg deliberately skips NOT is_aggregate --
legacy IG lives almost entirely on aggregate rows, and the aggregate codes are
year-disjoint from their modern leaf components, so nothing double-counts.
L-- (the IG-to-state family total) is excluded. direct is the default and is
numerically unchanged.
This commit is contained in:
2026-07-27 09:28:17 -04:00
parent 7ed1da9b79
commit fefd4fe969
8 changed files with 208 additions and 8 deletions
+11 -1
View File
@@ -11,7 +11,8 @@ cog_spending(
per_capita = FALSE,
adjust_to_year = NULL,
basis = c("harmonized", "raw"),
recipe = NULL
recipe = NULL,
expenditure_concept = c("direct", "total")
)
}
\arguments{
@@ -55,6 +56,15 @@ argument is ignored and the result's provenance reports
`basis = "recipe"` with an inert `harmonization` block (`applied =
FALSE`, pointing at the `recipe` block instead) rather than a
possibly-misleading `"harmonized"`/`"raw"` value.}
\item{expenditure_concept}{`"direct"` (default) returns only the
government's own direct spending (item codes `E`/`F`/`G`), unchanged
from prior releases. `"total"` additionally UNIONs in the
intergovernmental leg -- payments to local governments (`M` codes) and
to the state government (`L` codes, excluding the `L--` family-total
rollup) -- so results gain rows with `spend_subtype ==
"intergovernmental"`. Mutually exclusive with `recipe` (a recipe
already defines its own component codes).}
}
\value{
Tibble with columns `year`, `canonical_govid`, `gov_name`,