A technical working paper for this package can be found here.
Adjust monetary values for inflation across 13 currencies and 60+ years. Convert historical prices to today’s money, calculate inflation rates, or reverse the calculation to find what a modern amount would have been worth in the past. Uses both CPI and GDP deflator indices from the World Bank.
Getting consistent, comparable inflation data across multiple countries and many decades is harder than it sounds. Each country has its own national statistics agency, its own methodology, and its own publication format. The World Bank Development Indicators solve this by aggregating data from national sources into a single, consistently formatted dataset - with the World Bank handling source reconciliation. All series are rescaled to 2020 = 100 for consistency across currencies.
install.packages("inflateR")
# Or install the development version from GitHub
# install.packages("devtools")
devtools::install_github("charlescoverdale/inflateR")inflateR has no runtime dependencies and requires no API key or internet connection. All data is bundled directly inside the package.
inflateR provides two methods for adjusting monetary values across time. Choosing between them depends on what you’re adjusting.
Use CPI (adjust_inflation,
historical_value) for: - Wages and salaries -
“What would a £30,000 salary in 1990 be worth today?” -
Everyday prices - “What is £12 from 1963 worth in today’s
money?” - Household budgets and cost of living comparisons - Retail
prices, rents, consumer spending
CPI tracks the price of a fixed basket of goods and services that a typical household buys. It’s the most intuitive measure for anything a person earns or spends.
Use GDP deflator (adjust_real,
historical_real) for: - GDP figures - “How
does UK GDP in 1980 compare to today in real terms?” - Government
expenditure - “What would the 2000 defence budget be worth
today?” - Business investment and capital expenditure - Any
macroeconomic aggregate you want to compare across time
The GDP deflator covers all goods and services produced in the economy - not just the consumer basket. It updates automatically (no fixed basket) and excludes imported goods, making it more appropriate for economy-wide comparisons.
When in doubt: if you’re talking about something a person earns, buys, or pays for - use CPI. If you’re talking about a number from a national accounts table - use the GDP deflator.
inflateR provides six functions: four adjustment functions in two
symmetric pairs, plus inflation_rate() and
list_currencies():
| Direction | CPI | GDP deflator |
|---|---|---|
| Historical → present | adjust_inflation() |
adjust_real() |
| Present → historical | historical_value() |
historical_real() |
library(inflateR)
# CPI: adjust a historical value to today's money
adjust_inflation(amount, from_year, currency, to_year = NULL, round = 2)
# CPI: convert a present value back to a historical year
historical_value(amount, to_year, currency, from_year = NULL, round = 2)
# GDP deflator: adjust a historical value to today's money
adjust_real(amount, from_year, currency, to_year = NULL, round = 2)
# GDP deflator: convert a present value back to a historical year
historical_real(amount, to_year, currency, from_year = NULL, round = 2)
# Calculate cumulative or annualised inflation rate
inflation_rate(from_year, to_year = NULL, currency, annualise = FALSE)
# See all supported currencies and data coverage
list_currencies()All four adjustment functions accept the same currency codes and country names and are exact inverses within each pair.
| Argument | Description |
|---|---|
amount |
Numeric (scalar or vector). The monetary amount(s) to convert |
from_year |
Integer. The year the amount is from |
to_year |
Integer. The target year (forward functions default to latest available; inverse functions require this) |
currency |
Character. Currency code ("GBP", "AUD",
"USD", "EUR", "CAD",
"JPY", "CNY", "CHF",
"NZD", "INR", "KRW",
"BRL", "NOK") or country name
("Australia", "United States",
"New Zealand", "India", "Norway",
etc.) - case-insensitive |
from_year |
Integer. For inverse functions: the year the amount is from (defaults to latest available) |
round |
Integer or NULL. Decimal places (default 2). Use
NULL for full precision |
annualise |
Logical. If TRUE, inflation_rate() returns
the compound annual rate |
# What is £12 from 1963 worth today?
adjust_inflation(12, 1963, "GBP")
#> [1] 256.43
# What is $50 USD from 1980 worth today?
adjust_inflation(50, 1980, "USD")
#> [1] 190.33
# What is AUD 100 from 1990 worth today?
adjust_inflation(100, 1990, "AUD")
#> [1] 241.39
# Adjust to a specific year rather than today
adjust_inflation(100, 1970, "GBP", to_year = 2000)
#> [1] 872.45
# What would £100 today have been worth in 1963?
historical_value(100, 1963, "GBP")
#> [1] 4.68
# What would USD 1000 in 2020 have been worth in 1990?
historical_value(1000, 1990, "USD", from_year = 2020)
#> [1] 504.80# UK GDP was roughly £500bn in 1990 - what is that in today's terms?
adjust_real(500e9, 1990, "GBP")
#> [1] 1214415929203
# What would $1 trillion of US government spending in 2000 be worth in 2020?
adjust_real(1e12, 2000, "USD", to_year = 2020)
#> [1] 1428890000000
# Reverse: what would today's UK GDP of £2.5 trillion have been in 1990 terms?
historical_real(2.5e12, 1990, "GBP")
#> [1] 1028928849648# Cumulative US inflation from 2000 to 2020
inflation_rate(2000, 2020, "USD")
#> [1] 0.5030
# Annualised UK inflation from 1990 to 2020
inflation_rate(1990, 2020, "GBP", annualise = TRUE)
#> [1] 0.0248# Adjust multiple amounts at once
adjust_inflation(c(100, 500, 1000), 2000, "GBP", to_year = 2020)
#> [1] 161.56 807.80 1615.61
# Full precision (no rounding)
adjust_inflation(100, 2000, "USD", to_year = 2020, round = NULL)
#> [1] 150.303...# See all supported currencies
list_currencies()
#> currency country cpi_start cpi_end deflator_start deflator_end
#> 1 GBP United Kingdom 1960 2025 1960 2025
#> 2 AUD Australia 1960 2025 1960 2025
#> ...adjust_inflation(12, 1963, "Australia") #> 218.09
adjust_inflation(12, 1963, "switzerland") #> 48
adjust_real(500e9, 1990, "United Kingdom") #> 1263091626371All data is sourced from the World Bank Development Indicators and bundled inside the package. All indices are rescaled so that 2020 = 100.
Coverage is not uniform at the recent end. Every series runs to 2025
except US CPI, which the World Bank has not yet published beyond 2024,
so adjust_inflation() with currency = "USD"
rejects a 2025 target year and names 2024 as the limit. The US GDP
deflator does reach 2025, so adjust_real() is unaffected.
Brazil starts at 1990: rebasing to 2020 = 100 pushes the hyperinflation
years before that below the resolution of the stored index, and those
years are dropped rather than shipped as zeros.
FP.CPI.TOTL)| Dataset | Currency | Coverage |
|---|---|---|
uk_cpi |
GBP | 1960–2025 |
aud_cpi |
AUD | 1960–2025 |
usd_cpi |
USD | 1960–2024 |
eur_cpi |
EUR | 1960–2025 (Germany proxy) |
cad_cpi |
CAD | 1960–2025 |
jpy_cpi |
JPY | 1960–2025 |
cny_cpi |
CNY | 1986–2025 |
chf_cpi |
CHF | 1960–2025 |
nzd_cpi |
NZD | 1960–2025 |
inr_cpi |
INR | 1960–2025 |
krw_cpi |
KRW | 1960–2025 |
brl_cpi |
BRL | 1990–2025 |
nok_cpi |
NOK | 1960–2025 |
NY.GDP.DEFL.ZS)| Dataset | Currency | Coverage |
|---|---|---|
uk_gdp_def |
GBP | 1960–2025 |
aud_gdp_def |
AUD | 1960–2025 |
usd_gdp_def |
USD | 1960–2025 |
eur_gdp_def |
EUR | 1960–2025 (Germany proxy) |
cad_gdp_def |
CAD | 1960–2025 |
jpy_gdp_def |
JPY | 1960–2025 |
cny_gdp_def |
CNY | 1960–2025 |
chf_gdp_def |
CHF | 1960–2025 |
nzd_gdp_def |
NZD | 1960–2025 |
inr_gdp_def |
INR | 1960–2025 |
krw_gdp_def |
KRW | 1960–2025 |
brl_gdp_def |
BRL | 1990–2025 |
nok_gdp_def |
NOK | 1960–2025 |
Inflation adjustment requires converting 12 monthly CPI observations into a single yearly figure. The CPI in January vs December of the same year can differ by 1-2%, so how that conversion is done matters more than which tool you use.
FP.CPI.TOTL), published
rounded to 2 decimal places. Other tools may use the annual percentage
change series (FP.CPI.TOTL.ZG), which retains more decimal
places and is compounded year by year. Both come from the same
underlying national CPI data. The rounding difference is tiny: $100,000
from 2020 to 2024 gives $121,200 with inflateR vs $121,204 with a
compounding approach, a gap of $4 (0.003%). ## Related packages| Package | Description |
|---|---|
inflationkit |
Inflation analysis (decomposition, persistence, Phillips curve) |
ons |
UK Office for National Statistics data (CPI source) |
boe |
Bank of England data |
fred |
US Federal Reserve (FRED) data |
readecb |
European Central Bank data |
ukhousing |
UK Land Registry data (real-terms house prices) |
Please report bugs or requests at https://github.com/charlescoverdale/inflateR/issues.
inflation adjustment, CPI, consumer price index, GDP deflator, purchasing power, real prices, nominal to real, price index, cost of living, World Bank, historical prices, inflation rate, deflation, currency adjustment, international inflation, R package, macroeconomics, economics data