Discovery verb over the summary_categories view, grouped one row per (category, subtype). Parallels cog_gov_search: analysts use it to find the valid `category` values to pass into cog_spending(), cog_revenue(), cog_geographic_rollup(). Columns: category, category_type, subtype, n_codes, item_codes (comma-separated, alphabetical). Optional filters: type = NULL | "spending" | "revenue" pattern = regex matched case-insensitively on category The user-facing "spending" alias is translated internally to the corpus-native "expenditure" so callers don't have to learn Census vocabulary, while the returned category_type column preserves the native value for auditability. Also: fix @noRd placement in session.R so devtools::document() stops warning. Tests: +16 new / 181 total pass. check 0E/0W/0N.
29 lines
981 B
R
29 lines
981 B
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/categories.R
|
|
\name{cog_categories}
|
|
\alias{cog_categories}
|
|
\title{List available spending / revenue categories}
|
|
\usage{
|
|
cog_categories(type = NULL, pattern = NULL)
|
|
}
|
|
\arguments{
|
|
\item{type}{Either `NULL` (default, return both spending and revenue
|
|
rows), `"spending"`, or `"revenue"`.}
|
|
|
|
\item{pattern}{Optional regex matched case-insensitively against the
|
|
`category` column (e.g. `"Police"` or `"Tax"`).}
|
|
}
|
|
\value{
|
|
Tibble with columns `category`, `category_type`, `subtype`,
|
|
`n_codes`, `item_codes` (comma-separated, alphabetical). Sorted by
|
|
`category_type`, `category`, `subtype`.
|
|
}
|
|
\description{
|
|
Returns the category taxonomy exposed by the corpus's
|
|
`summary_categories` view, grouped to one row per
|
|
`(category, subtype)` pair. Use this to discover valid `category`
|
|
values for [cog_spending()] / [cog_revenue()] /
|
|
[cog_geographic_rollup()] and to audit which Census item codes feed
|
|
each category.
|
|
}
|