% 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, every row: expenditure, revenue and balance), `"spending"`, `"revenue"`, or `"balance"`.} \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`. Includes one row per flow for the reserved pseudo-category `"All Categories"`, which carries `NA` for `subtype`, `n_codes` and `item_codes` because it is a query mode rather than a crosswalk entry — see [cog_spending()]'s `category` argument. } \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_balances()] / [cog_geographic_rollup()] and to audit which Census item codes feed each category. } \details{ `subtype` COALESCEs the crosswalk's three subtype columns, so it carries `spend_subtype` on expenditure rows, `revenue_subtype` on revenue rows and `balance_subtype` on balance rows. Note that [cog_balances()] itself takes no `subtype` argument — for holdings, `category` is a strict coarsening of `balance_subtype` — but the value is surfaced here because it is the discovery surface downstream consumers build their vocabulary from. }