45 lines
1.5 KiB
R
45 lines
1.5 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/revenue.R
|
|
\name{cog_revenue}
|
|
\alias{cog_revenue}
|
|
\title{Summarized revenue by category}
|
|
\usage{
|
|
cog_revenue(
|
|
govid,
|
|
years,
|
|
category = NULL,
|
|
per_capita = FALSE,
|
|
adjust_to_year = NULL
|
|
)
|
|
}
|
|
\arguments{
|
|
\item{govid}{Character vector of `canonical_govid` values.}
|
|
|
|
\item{years}{Integer vector of years.}
|
|
|
|
\item{category}{Character vector of category names (from
|
|
`summary_categories.category`), or `NULL` for all categories.}
|
|
|
|
\item{per_capita}{If `TRUE`, adds `amt_per_capita_nominal` (and
|
|
`amt_per_capita_real` when `adjust_to_year` is set) using the per-year
|
|
Census F-33 population from `gov_population_yearly`. Result also gains
|
|
a `pop_source` column with values `"census_f33"` or `"unavailable"`
|
|
(the latter for gov types 4/5 and any row whose population is missing
|
|
in that year).}
|
|
|
|
\item{adjust_to_year}{Integer base year for CPI-U real-dollar conversion,
|
|
or `NULL` for nominal only.}
|
|
}
|
|
\value{
|
|
Tibble with columns `year`, `canonical_govid`, `gov_name`,
|
|
`revenue_subtype`, `category`, `amt_nominal`, optional `amt_real`,
|
|
optional `amt_per_capita_nominal`, optional `amt_per_capita_real`,
|
|
optional `pop_source`, `codes_included`, `aggregate_fallback`, `notes`.
|
|
}
|
|
\description{
|
|
Mirror of [cog_spending()] for revenue categories. One row per
|
|
`(year, canonical_govid, revenue_subtype, category)`. Amounts are returned
|
|
in **full U.S. dollars** (raw Census values are in $1,000s; this verb
|
|
multiplies by 1000 and records the conversion in `provenance`).
|
|
}
|