Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoch94 committed Apr 16, 2024
1 parent a4c5858 commit 15956d3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 4 deletions.
35 changes: 33 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ knitr::opts_chunk$set(

<!-- badges: start -->

[![CRAN status](https://www.r-pkg.org/badges/version/GDPuc)](https://CRAN.R-project.org/package=GDPuc) [![R-CMD-check](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/pik-piam/GDPuc/branch/main/graph/badge.svg?token=3GHXFQXARX)](https://app.codecov.io/gh/pik-piam/GDPuc) ![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)
[![R-CMD-check](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/GDPuc)](https://CRAN.R-project.org/package=GDPuc) [![check](https://github.com/pik-piam/GDPuc/actions/workflows/check.yaml/badge.svg)](https://github.com/pik-piam/GDPuc/actions/workflows/check.yaml)
[![codecov](https://codecov.io/gh/pik-piam/GDPuc/branch/main/graph/badge.svg?token=3GHXFQXARX)](https://app.codecov.io/gh/pik-piam/GDPuc)
![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)
<!-- badges: end -->

GDPuc (a.k.a. the GDP unit-converter) provides a simple function to convert GDP time-series data from one unit to another.
Expand Down Expand Up @@ -71,6 +72,19 @@ The `unit_in` and `unit_out` arguments specify the incoming and outgoing GDP uni

Here "YYYY" is a placeholder for a year, e.g. "2010" or "2015", and "LCU" stands for Local Currency Unit.

For a quick conversion of a single value use `convertSingle`.

```{r usage2, eval=FALSE}
convertSingle(
x = 100,
iso3c = "FRA",
year = 2000,
unit_in = "current LCU",
unit_out = "constant 2017 Int$PPP"
)
```


## Example

```{r example1}
Expand All @@ -88,6 +102,23 @@ convertGDP(
unit_in = "constant 2005 LCU",
unit_out = "constant 2017 Int$PPP"
)
convertSingle(
x = 100,
iso3c = "USA",
year = 2010,
unit_in = "current LCU",
unit_out = "constant 2017 Int$PPP"
)
# When converting between constant currencies, the year of the GDP value is not important,
# and can be left out.
convertSingle(
x = 100,
iso3c = "USA",
unit_in = "constant 2005 LCU",
unit_out = "constant 2017 Int$PPP"
)
```

## Further Options
Expand Down
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

[![CRAN
status](https://www.r-pkg.org/badges/version/GDPuc)](https://CRAN.R-project.org/package=GDPuc)
[![R-CMD-check](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml)
[![check](https://github.com/pik-piam/GDPuc/actions/workflows/check.yaml/badge.svg)](https://github.com/pik-piam/GDPuc/actions/workflows/check.yaml)
[![codecov](https://codecov.io/gh/pik-piam/GDPuc/branch/main/graph/badge.svg?token=3GHXFQXARX)](https://app.codecov.io/gh/pik-piam/GDPuc)
![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)
[![R-CMD-check](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pik-piam/GDPuc/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

GDPuc (a.k.a. the GDP unit-converter) provides a simple function to
Expand Down Expand Up @@ -71,6 +70,18 @@ GDP units. All common GDP units are supported, i.e.:
Here “YYYY” is a placeholder for a year, e.g. “2010” or “2015”, and
“LCU” stands for Local Currency Unit.

For a quick conversion of a single value use `convertSingle`.

``` r
convertSingle(
x = 100,
iso3c = "FRA",
year = 2000,
unit_in = "current LCU",
unit_out = "constant 2017 Int$PPP"
)
```

## Example

``` r
Expand Down Expand Up @@ -104,6 +115,25 @@ convertGDP(
#> 3 USA 2012 126.
#> 4 USA 2013 127.
#> 5 USA 2014 128.

convertSingle(
x = 100,
iso3c = "USA",
year = 2010,
unit_in = "current LCU",
unit_out = "constant 2017 Int$PPP"
)
#> [1] 112.0447

# When converting between constant currencies, the year of the GDP value is not important,
# and can be left out.
convertSingle(
x = 100,
iso3c = "USA",
unit_in = "constant 2005 LCU",
unit_out = "constant 2017 Int$PPP"
)
#> [1] 123.1357
```

## Further Options
Expand Down

0 comments on commit 15956d3

Please sign in to comment.