Files
uscogdata/NAMESPACE
T
Claude b6b3e4652a feat: fiscal-year periods on the verbs and survey-year helpers (#77)
`year` is the Census survey year, and Census files a government's fiscal
year under survey year Y when it ended between July 1 of Y-1 and June 30
of Y, so one survey year covers different months for different
governments.

cog_spending(), cog_revenue() and cog_balances() gain a trailing
`fiscal_period = FALSE`. With TRUE, every row gains fiscal_year_end (MMDD
integer), period_start and period_end (Dates, inclusive), looked up per
government-year from long.fiscal_year_end so a change of fiscal year is
respected, plus provenance$transformations$fiscal_period. With the
default, columns and provenance are exactly as before.

cog_fiscal_periods(govid, years) returns the govid x years grid of
periods; cog_survey_year(govid, date) returns the survey year whose
period contains a date, using each candidate year's own fiscal_year_end
and returning NA rather than borrowing another year's value.

State governments, and the District of Columbia, cover the fiscal year
ending in calendar year Y. That changes Alabama, Michigan (September 30)
and Texas (August 31). Census's 2004 and 2006 technical documentation
lists those exceptions, and the corpus agrees for survey year 2020: those
states' federal aid rises with the CARES Act in 2020 while New York's and
15 large September-30 local governments' rises in 2021. D.C. rests on the
documentation alone.

Tests run against the bundled fixture (85 expectations).

Refs #77

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

19 lines
423 B
Plaintext

# Generated by roxygen2: do not edit by hand
export(cog_balances)
export(cog_basket_resolution)
export(cog_basket_unresolved)
export(cog_categories)
export(cog_explain)
export(cog_find_peers)
export(cog_fiscal_periods)
export(cog_geographic_rollup)
export(cog_gov_search)
export(cog_manifest)
export(cog_mirror)
export(cog_peer_compare)
export(cog_recipes)
export(cog_revenue)
export(cog_spending)
export(cog_survey_year)