Also regenerates man/cog_suggestions.Rd, which landed after that branch was
cut and still carried literal markdown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
A second natural experiment for the state-government rule in R/fiscal.R,
using IG Federal revenue from the public API (corpus build 2026-10-26,
fccd87c), survey years 2006-2011:
- Alabama and Michigan (September 30) and Texas (August 31) jump in
survey year 2009 (+18.0%, +22.2%, +12.3%) and slow in 2011 (-4.7%,
+3.9%, +4.3%), as the June 30 states do (median +12.4%, +3.6%). Under
the plain rule their 2009 would end in 2008, before the stimulus, and
their 2011 would be the full stimulus year.
- 15 large September-30 cities and counties jump in 2011 (median +17.7%,
against +2.1% and +3.1% in 2009 and 2010), as the plain rule predicts.
- D.C. is inconclusive again: its 2009 is flat (+4.1%), like the plain
rule, but its 2011 falls (-0.9%), like the documented one.
The data agrees with the code, so the rule and
.SURVEY_YEAR_SAME_YEAR_GOVIDS are unchanged. The header comment and the
"survey-year rule" section now cite survey years 2009 and 2020 for the
state rule and say D.C. was inconclusive in both. man/ regenerated with
roxygen2 7.3.3.
Refs #77
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qbe6u2h83wgZdTgJgE4Xh5
Measured across all 56 years on the public corpus: 99% of FY1993
government-years have no usable fiscal_year_end, as do 5% to 11% in FY1978
and FY1987 to FY1990, and under 3% elsewhere. The table is on #77.
Refs #77
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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