Files
uscogdata/man/cog_categories.Rd
T
Claude 19b5b02d2f docs: render the roxygen markdown the reference pages are written in
The roxygen comments use markdown (**bold**, `code`, [cog_x()] links,
bullet lists) but DESCRIPTION had no `Roxygen: list(markdown = TRUE)`,
so the generated .Rd files carried that syntax literally. It also meant
a bare `%` started an Rd comment and silently cut the rest of its line
from seven places in the rendered pages, including "7% of the no-filter
floor", "-32.7% to +251.0% across 24 years" and the `filter(role %in%
...)` line of cog_peer_compare()'s example.

Adds the setting and regenerates man/ with roxygen2 7.3.3 (matching
RoxygenNote). The only source change is escaping one literal
"[min year, max year]" in an @noRd block in R/balance_caveats.R, which
markdown mode otherwise reads as a link. No wording or code changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qbe6u2h83wgZdTgJgE4Xh5
2026-11-04 20:21:24 +00:00

40 lines
2.0 KiB
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 \code{NULL} (default, every row: expenditure, revenue and
balance), \code{"spending"}, \code{"revenue"}, or \code{"balance"}.}
\item{pattern}{Optional regex matched case-insensitively against the
\code{category} column (e.g. \code{"Police"} or \code{"Tax"}).}
}
\value{
Tibble with columns \code{category}, \code{category_type}, \code{subtype},
\code{n_codes}, \code{item_codes} (comma-separated, alphabetical). Sorted by
\code{category_type}, \code{category}, \code{subtype}. Includes one row per flow for the
reserved pseudo-category \code{"All Categories"}, which carries \code{NA} for
\code{subtype}, \code{n_codes} and \code{item_codes} because it is a query mode rather
than a crosswalk entry — see \code{\link[=cog_spending]{cog_spending()}}'s \code{category} argument.
}
\description{
Returns the category taxonomy exposed by the corpus's
\code{summary_categories} view, grouped to one row per
\verb{(category, subtype)} pair. Use this to discover valid \code{category}
values for \code{\link[=cog_spending]{cog_spending()}} / \code{\link[=cog_revenue]{cog_revenue()}} / \code{\link[=cog_balances]{cog_balances()}} /
\code{\link[=cog_geographic_rollup]{cog_geographic_rollup()}} and to audit which Census item codes feed
each category.
}
\details{
\code{subtype} COALESCEs the crosswalk's three subtype columns, so it carries
\code{spend_subtype} on expenditure rows, \code{revenue_subtype} on revenue rows and
\code{balance_subtype} on balance rows. Note that \code{\link[=cog_balances]{cog_balances()}} itself takes
no \code{subtype} argument — for holdings, \code{category} is a strict coarsening of
\code{balance_subtype} — but the value is surfaced here because it is the
discovery surface downstream consumers build their vocabulary from.
}