Adds R/sysdata.rda with the annual-average CPIAUCSL index (1947-2026, 80 years, sourced from FRED) and an internal .inflate() helper that converts nominal amounts between two years via the ratio of CPI values. Bundling CPI in the package (rather than publishing a cpi_annual.parquet in the corpus) matches the reader-specification intent: real-dollar conversion is a verb-level option, not a corpus-level artifact, so the target_year stays flexible at query time. data-raw/cpi_annual.R carries the one-shot FRED refresh used to build sysdata.rda. Re-run when the CPI series needs to roll forward. Verified: CPI(2000)/CPI(2021) ≈ 0.635, matching the ~0.63 sanity anchor in cog_explorer's existing inflation logic. Tests: tests/testthat/test-adjust.R covers the known 2000→2021 ≈ 1.574x anchor, vectorized from_year, error cases for out-of-range years, and NA-amount preservation. 14 pass / 0 fail.
13 lines
142 B
Plaintext
13 lines
142 B
Plaintext
^data-raw$
|
|
^.*\.Rproj$
|
|
^\.Rproj\.user$
|
|
^_pkgdown\.yml$
|
|
^docs$
|
|
^pkgdown$
|
|
^\.github$
|
|
^LICENSE\.md$
|
|
^\.git$
|
|
^\.gitignore$
|
|
\.gitkeep$
|
|
^vignettes$
|