I was surprised to see there weren’t more of these types of calculators in the R community. Inflation and adjusted payments seem like they would be more common. I was able to find a way to gather Consumer Price Index data using the quantmod package but quantmod leaves you to your own devices in converting the data. So, I whipped up a formula, this will most likely be incorporated into my upcoming BLS scrape package.
The function grabs the CPI data as a flat file, converts the data to an xts object and finds the average CPI index for each year. It then calculates an adjusted “dollar” by dividing the average CPI for your target year to your base year and uses that multiplier to calculate the value of a dollar for any given year related to your base year.
Note: for this to work you must have a “base year,” i.e. something to compare to. So, if I wanted to know the current-day value of $1.00 USD from 1947, I would use 1947 for my base year and find out the 2015 value is $10.62.
To check the math, I can go to the BLS inflation calculator web-app.