docs(peers): document cohort_year on cog_peer_compare return

This commit is contained in:
2026-04-29 17:45:05 -04:00
parent a92450ff76
commit cadce8d528
2 changed files with 12 additions and 6 deletions
+6 -3
View File
@@ -143,9 +143,12 @@ cog_find_peers <- function(target_govid,
#' @param adjust_to_year Integer base year for CPI-U conversion or `NULL`.
#' @return Tibble matching [cog_spending()]'s columns, plus a `role`
#' column taking values `"target"`, `"peer"`, `"summary_p25"`,
#' `"summary_p50"`, or `"summary_p75"`, and `target_rank` (target's rank
#' among target+peers at `max(years)`, NA for other rows). Provenance
#' attribute reports `verb = "cog_peer_compare"` and `peer_count`.
#' `"summary_p50"`, or `"summary_p75"`, `target_rank` (target's rank
#' among target+peers at `max(years)`, NA for other rows), and
#' `cohort_year` (the year used to build the peer cohort, read from
#' `attr(peers, "cohort_year")`; `NA` when `peers` was a bare character
#' vector). Provenance reports `verb = "cog_peer_compare"`, `peer_count`,
#' `cohort_year`, and `cohort_govids`.
#' @export
cog_peer_compare <- function(target_govid, peers, category, years,
per_capita = TRUE, adjust_to_year = NULL) {
+6 -3
View File
@@ -31,9 +31,12 @@ population.}
\value{
Tibble matching [cog_spending()]'s columns, plus a `role`
column taking values `"target"`, `"peer"`, `"summary_p25"`,
`"summary_p50"`, or `"summary_p75"`, and `target_rank` (target's rank
among target+peers at `max(years)`, NA for other rows). Provenance
attribute reports `verb = "cog_peer_compare"` and `peer_count`.
`"summary_p50"`, or `"summary_p75"`, `target_rank` (target's rank
among target+peers at `max(years)`, NA for other rows), and
`cohort_year` (the year used to build the peer cohort, read from
`attr(peers, "cohort_year")`; `NA` when `peers` was a bare character
vector). Provenance reports `verb = "cog_peer_compare"`, `peer_count`,
`cohort_year`, and `cohort_govids`.
}
\description{
Pulls spending for the target plus a peer set (either a