The {deflator} package is a demonstration of how to create a simple
package. It has one function, flate_gdp()
, for inflating or deflating
UK prices by GDP. It also has one dataset, gdp_deflator
, which is a
data frame of year-on-year inflation rates published on
GOV.UK.
You can install from github with:
devtools::install_github("nacnudus/deflator")
Inflate £100 from 2017 prices to 2019 prices, by GDP.
library(deflator)
flate_gdp(100, 2017, 2019)
#> [1] 103.9335
Go back again: deflate £103 from 2019 prices to 2017 prices, by GDP.
flate_gdp(103.9335, 2019, 2017)
#> [1] 100