An open API service indexing awesome lists of open source software.

https://github.com/nacnudus/deflator

Deflate and inflate UK Prices by GDP
https://github.com/nacnudus/deflator

Last synced: 2 months ago
JSON representation

Deflate and inflate UK Prices by GDP

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# deflator

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](https://www.gov.uk/government/statistics/gdp-deflators-at-market-prices-and-money-gdp-march-2019-quarterly-national-accounts).

## Installation

You can install from [github](https://github.com/nacnudus/deflator) with:

```r
devtools::install_github("nacnudus/deflator")
```

## Example

Inflate £100 from 2017 prices to 2019 prices, by GDP.

```{r inflate}
library(deflator)
flate_gdp(100, 2017, 2019)
```

Go back again: deflate £103 from 2019 prices to 2017 prices, by GDP.

```{r deflate}
flate_gdp(103.9335, 2019, 2017)
```