Refreshed from the World Bank Development Indicators. Every series gains 2025 except US CPI, which the World Bank has not yet published beyond 2024. The US GDP deflator does reach 2025.
Results will change. Two separate reasons:
to_year defaults to the latest year
available, which has moved from 2024 to 2025. For example
adjust_inflation(12, 1963, "Australia") returned 212.02 and now
returns 218.09. Pass an explicit to_year if you need the old answer.Rebasing to 2020 = 100 pushes Brazil's hyperinflation years so far below
the base that four decimal places cannot represent them, and they were
being stored as exactly zero. A zero index divides, so
adjust_inflation(100, 1985, 2020, currency = "BRL") returned Inf
rather than refusing the request. Those years are now dropped, so the
ordinary coverage check rejects them with a message naming the real
range. 40 stored values were affected across brl_cpi and
brl_gdp_def.
Three "known value" tests hardcoded index constants (5.71, 66.53, 69.9844) and so failed the moment the World Bank revised history. They now read the index from the bundled data, which tests the arithmetic without turning every refresh into a failure that says nothing about the code.
Three vectorisation tests asserted result[2] == result[1] * 2 on
rounded output. With per-element rounding round(2x, 2) need not equal
2 * round(x, 2), so the assertion was unsound and happened to hold
only for the old data. They now pass round = NULL; the round
argument keeps its own separate tests.
inflation_rate() for calculating cumulative or annualised inflation rates between any two yearslist_currencies() to show all supported currencies and their data coverageround parameter to all four adjustment functions (round = 2 default preserves backward compatibility; use round = NULL for full precision)amount inputsdata-raw/cpi_data.R to cover all 13 currencies and both CPI and GDP deflator series in a single scriptadjust_real() for GDP deflator-based adjustment (World Bank NY.GDP.DEFL.ZS)adjust_real() accepts the same currency codes and country names as adjust_inflation()