docs(per-capita): refresh roxygen for per-year denominator + pop_source
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@
|
||||
#' @return 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`,
|
||||
#' `codes_included`, `aggregate_fallback`, `notes`.
|
||||
#' optional `pop_source`, `codes_included`, `aggregate_fallback`, `notes`.
|
||||
#' @export
|
||||
cog_revenue <- function(govid, years, category = NULL,
|
||||
per_capita = FALSE, adjust_to_year = NULL) {
|
||||
|
||||
+7
-4
@@ -13,15 +13,18 @@
|
||||
#' @param category Character vector of category names (from
|
||||
#' `summary_categories.category`), or `NULL` for all categories.
|
||||
#' @param per_capita If `TRUE`, adds `amt_per_capita_nominal` (and
|
||||
#' `amt_per_capita_real` when `adjust_to_year` is set) using
|
||||
#' `population_acs` from the canonical xwalk.
|
||||
#' `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).
|
||||
#' @param adjust_to_year Integer base year for CPI-U real-dollar conversion,
|
||||
#' or `NULL` for nominal only.
|
||||
#' @return Tibble with columns `year`, `canonical_govid`, `gov_name`,
|
||||
#' `spend_subtype`, `category`, `amt_nominal`, optional `amt_real`,
|
||||
#' optional `amt_per_capita_nominal`, optional `amt_per_capita_real`,
|
||||
#' `codes_included`, `aggregate_fallback`, `notes`. Carries a `provenance`
|
||||
#' attribute matching `inst/schemas/provenance-v1.json`.
|
||||
#' optional `pop_source`, `codes_included`, `aggregate_fallback`, `notes`.
|
||||
#' Carries a `provenance` attribute matching `inst/schemas/provenance-v1.json`.
|
||||
#' @export
|
||||
cog_spending <- function(govid, years, category = NULL,
|
||||
per_capita = FALSE, adjust_to_year = NULL) {
|
||||
|
||||
+6
-3
@@ -21,8 +21,11 @@ cog_revenue(
|
||||
`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
|
||||
`population_acs` from the canonical xwalk.}
|
||||
`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.}
|
||||
@@ -31,7 +34,7 @@ or `NULL` for nominal only.}
|
||||
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`,
|
||||
`codes_included`, `aggregate_fallback`, `notes`.
|
||||
optional `pop_source`, `codes_included`, `aggregate_fallback`, `notes`.
|
||||
}
|
||||
\description{
|
||||
Mirror of [cog_spending()] for revenue categories. One row per
|
||||
|
||||
+7
-4
@@ -21,8 +21,11 @@ cog_spending(
|
||||
`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
|
||||
`population_acs` from the canonical xwalk.}
|
||||
`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.}
|
||||
@@ -31,8 +34,8 @@ or `NULL` for nominal only.}
|
||||
Tibble with columns `year`, `canonical_govid`, `gov_name`,
|
||||
`spend_subtype`, `category`, `amt_nominal`, optional `amt_real`,
|
||||
optional `amt_per_capita_nominal`, optional `amt_per_capita_real`,
|
||||
`codes_included`, `aggregate_fallback`, `notes`. Carries a `provenance`
|
||||
attribute matching `inst/schemas/provenance-v1.json`.
|
||||
optional `pop_source`, `codes_included`, `aggregate_fallback`, `notes`.
|
||||
Carries a `provenance` attribute matching `inst/schemas/provenance-v1.json`.
|
||||
}
|
||||
\description{
|
||||
One row per `(year, canonical_govid, spend_subtype, category)`. Amounts are
|
||||
|
||||
Reference in New Issue
Block a user