MyNixOS website logo
Description

Inflation Adjustment for Historical Currency Values.

Convert historical monetary values into their present-day equivalents using bundled CPI (Consumer Price Index) and GDP deflator data sourced from the World Bank Development Indicators. Supports British pounds (GBP), Australian dollars (AUD), US dollars (USD), Euro (EUR), Canadian dollars (CAD), Japanese yen (JPY), Chinese yuan (CNY), Swiss francs (CHF), New Zealand dollars (NZD), Indian rupees (INR), South Korean won (KRW), Brazilian reais (BRL), and Norwegian krone (NOK). Currency codes and country names are both accepted as input.

inflateR

CRAN status

Convert historical monetary values into their present-day equivalents — or reverse the calculation to find what a modern amount would have been worth in the past. Supports GBP, AUD, USD, EUR, CAD, JPY, CNY, CHF, NZD, INR, KRW, BRL, and NOK.

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.

Installation

install.packages("inflateR")

Or install the development version from GitHub:

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.

CPI vs GDP deflator — which should I use?

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.

Functions

inflateR provides four functions in two symmetric pairs:

DirectionCPIGDP deflator
Historical → presentadjust_inflation()adjust_real()
Present → historicalhistorical_value()historical_real()
library(inflateR)

# CPI: adjust a historical value to today's money
adjust_inflation(amount, from_year, currency, to_year = NULL)

# CPI: convert a present value back to a historical year
historical_value(amount, to_year, currency, from_year = NULL)

# GDP deflator: adjust a historical value to today's money
adjust_real(amount, from_year, currency, to_year = NULL)

# GDP deflator: convert a present value back to a historical year
historical_real(amount, to_year, currency, from_year = NULL)

All four functions accept the same currency codes and country names and are exact inverses within each pair.

Arguments

ArgumentDescription
amountNumeric. The monetary amount to convert
from_yearInteger. The year the amount is from
to_yearInteger. The target year (forward functions default to latest available; inverse functions require this)
currencyCharacter. 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_yearInteger. For inverse functions: the year the amount is from (defaults to latest available)

Examples

CPI: adjusting everyday values

# 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

GDP deflator: adjusting macroeconomic values

# 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

Country names work too (case-insensitive)

adjust_inflation(12, 1963, "Australia")   #> 212.02
adjust_inflation(12, 1963, "switzerland") #> 47.93
adjust_real(500e9, 1990, "United Kingdom") #> 1214415929203

Data

All data is sourced from the World Bank Development Indicators and bundled inside the package. All indices are rescaled so that 2020 = 100.

CPI datasets (indicator: FP.CPI.TOTL)

DatasetCurrencyCoverage
uk_cpiGBP1960–2024
aud_cpiAUD1960–2024
usd_cpiUSD1960–2024
eur_cpiEUR1960–2024 (Germany proxy)
cad_cpiCAD1960–2024
jpy_cpiJPY1960–2024
cny_cpiCNY1986–2024
chf_cpiCHF1960–2024
nzd_cpiNZD1960–2024
inr_cpiINR1960–2024
krw_cpiKRW1960–2024
brl_cpiBRL1980–2024
nok_cpiNOK1960–2024

GDP deflator datasets (indicator: NY.GDP.DEFL.ZS)

DatasetCurrencyCoverage
uk_gdp_defGBP1960–2024
aud_gdp_defAUD1960–2024
usd_gdp_defUSD1960–2024
eur_gdp_defEUR1960–2024 (Germany proxy)
cad_gdp_defCAD1960–2024
jpy_gdp_defJPY1960–2024
cny_gdp_defCNY1960–2024
chf_gdp_defCHF1960–2024
nzd_gdp_defNZD1960–2024
inr_gdp_defINR1960–2024
krw_gdp_defKRW1960–2024
brl_gdp_defBRL1960–2024
nok_gdp_defNOK1960–2024

Macroeconomic quirks

  • Tax shocks — Australia (GST, 2000) and Canada (GST, 1991) both saw one-time price level jumps that appear in the CPI data but are really structural tax changes. Comparisons spanning these years will reflect the tax shift, not just underlying inflation.
  • Japan's deflation — Japan had near-zero or negative inflation from roughly 1995 to 2020. Adjustments within this window will be very small, and in some years prices actually fell.
  • China's CPI coverage — World Bank CPI data for China begins in 1986. The GDP deflator series begins in 1960 but the early years span significant structural change. Both series are internationally comparable but may not capture the full experience of price changes during China's reform era.
  • Euro proxy — The World Bank does not publish an aggregated Euro area series for either CPI or GDP deflator. Germany is used as a proxy for both, which reflects the monetary anchor of the Eurozone but will understate the inflation experience of southern European countries in the 1970s and 1980s.
  • Annual figures only — All values are annual averages. Month-to-month volatility is smoothed out.

Issues

Please report bugs or requests at https://github.com/charlescoverdale/inflateR/issues.

Metadata

Version

0.1.3

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows