GDPuc

R package for GDP unit conversion

https://github.com/pik-piam/gdpuc

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.2%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

R package for GDP unit conversion

Basic Info
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 7
  • Open Issues: 3
  • Releases: 10
Created about 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Citation

README.Rmd

---
output: github_document
always_allow_html: yes
---



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

# GDPuc



[![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)


GDPuc (a.k.a. the GDP unit-converter) provides a simple function to convert GDP time-series data from one unit to another.

**To note:** The default conversion parameters are from the World Bank's World Development Indicators (WDI) database (see [link](https://databank.worldbank.org/source/world-development-indicators)). The current parameters are from **April 30th 2024**, with the next update planned for April 2026.

## Installation

```{r, eval = FALSE}
# Install from CRAN
install.packages("GDPuc")

# Or the development version from GitHub
remotes::install_github("pik-piam/GDPuc")
```

## Usage

Load the package.

```{r eval=FALSE}
library(GDPuc)
```

The main function of the package is `convertGDP`.

```{r usage1, eval=FALSE}
convertGDP(
  gdp = my_gdp,
  unit_in = "constant 2005 LCU",
  unit_out = "constant 2017 Int$PPP"
)
```

Here, the `gdp` argument takes a tibble or a data-frame that contains, at least:

-   a column with iso3c country codes, (ideally named "iso3c"),
-   a column with the year, (ideally named "year"),
-   a column named "value", with the gdp data.

The `unit_in` and `unit_out` arguments specify the incoming and outgoing GDP units. All common GDP units are supported, i.e.:

-   current LCU
-   current US$MER
-   current Int$PPP
-   constant YYYY LCU
-   constant YYYY US$MER
-   constant YYYY Int$PPP

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}
library(GDPuc)

my_gdp <- tibble::tibble(
  iso3c = "USA",
  year = 2010:2014,
  value = 100:104
)
print(my_gdp)

convertGDP(
  gdp = my_gdp,
  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

`convertGDP` has other arguments that allow you to:

-   choose conversion factors (see ["Choosing conversion factors"](https://pik-piam.github.io/GDPuc/articles/source.html))

-   print out information on the conversion process and/or return the conversion factors used (see ["Getting information on the conversion process"](https://pik-piam.github.io/GDPuc/articles/verbose.html))

-   handle missing conversion factors (see ["Handling missing conversion factors"](https://pik-piam.github.io/GDPuc/articles/handle_NAs.html))

-   convert regional GDP data (see ["Converting regional GDP data"](https://pik-piam.github.io/GDPuc/articles/with_regions.html))

Owner

  • Name: Potsdam Integrated Assessment Modelling (PIAM)
  • Login: pik-piam
  • Kind: organization
  • Location: Potsdam Institute for Climate Impact Research (PIK), Germany

Tools developed for use with data and models related to PIK's research.

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'GDPuc: Easily Convert GDP Data'
version: 1.4.1
date-released: '2024-10-23'
abstract: Convert GDP time series data from one unit to another. All common GDP units
  are included, i.e. current and constant local currency units, US$ via market exchange
  rates and international dollars via purchasing power parities.
authors:
- family-names: Koch
  given-names: Johannes
  email: jokoch@pik-potsdam.de
license: GPL (>= 3)
repository-code: https://github.com/pik-piam/GDPuc
url: https://pik-piam.github.io/GDPuc/

GitHub Events

Total
  • Push event: 4
  • Pull request event: 5
  • Create event: 1
Last Year
  • Push event: 4
  • Pull request event: 5
  • Create event: 1

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 94
  • Total Committers: 4
  • Avg Commits per committer: 23.5
  • Development Distribution Score (DDS): 0.085
Past Year
  • Commits: 13
  • Committers: 3
  • Avg Commits per committer: 4.333
  • Development Distribution Score (DDS): 0.154
Top Committers
Name Email Commits
Johannes Koch j****h@p****e 86
Pascal Führlich p****h@p****e 6
David Chen d****h@l****e 1
pre-commit-ci[bot] 6****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 16
  • Total pull requests: 23
  • Average time to close issues: 3 months
  • Average time to close pull requests: 20 days
  • Total issue authors: 2
  • Total pull request authors: 4
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.26
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 3
  • Pull requests: 7
  • Average time to close issues: 19 days
  • Average time to close pull requests: about 17 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.43
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • johanneskoch94 (15)
  • 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q (1)
  • caviddhen (1)
Pull Request Authors
  • johanneskoch94 (27)
  • pre-commit-ci[bot] (8)
  • fbenke-pik (2)
  • caviddhen (1)
Top Labels
Issue Labels
enhancement (1) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 355 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 24
  • Total versions: 10
  • Total maintainers: 1
cran.r-project.org: GDPuc

Easily Convert GDP Data

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 24
  • Downloads: 355 Last month
Rankings
Dependent repos count: 5.6%
Forks count: 9.6%
Average: 22.6%
Dependent packages count: 28.7%
Stargazers count: 30.8%
Downloads: 38.3%
Maintainers (1)
Last synced: 7 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • cli >= 2.4.0 imports
  • crayon * imports
  • dplyr * imports
  • glue * imports
  • lifecycle * imports
  • magrittr * imports
  • rlang >= 1.0.0 imports
  • tibble * imports
  • tidyselect * imports
  • withr * imports
  • WDI * suggests
  • covr * suggests
  • knitr * suggests
  • magclass * suggests
  • purrr * suggests
  • readxl * suggests
  • rmarkdown * suggests
  • stringr * suggests
  • testthat >= 3.0.0 suggests
  • tidyr * suggests
  • zoo * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/lucode2-check.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pat-s/always-upload-cache v3 composite
  • r-lib/actions/setup-pandoc v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite