r-wdi2

R package to access and analyze World Bank World Development Indicators (WDI)

https://github.com/tidy-intelligence/r-wbwdi

Science Score: 13.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.8%) to scientific vocabulary

Keywords

economic-data r
Last synced: 10 months ago · JSON representation

Repository

R package to access and analyze World Bank World Development Indicators (WDI)

Basic Info
Statistics
  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
economic-data r
Created almost 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
title: wbwdi
---


[![CRAN status](https://www.r-pkg.org/badges/version/wbwdi)](https://cran.r-project.org/package=wbwdi)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/wbwdi)](https://cran.r-project.org/package=wbwdi)
![R CMD Check](https://github.com/tidy-intelligence/r-wbwdi/actions/workflows/R-CMD-check.yaml/badge.svg)
![Lint](https://github.com/tidy-intelligence/r-wbwdi/actions/workflows/lint.yaml/badge.svg)
[![Codecov test coverage](https://codecov.io/gh/tidy-intelligence/r-wbwdi/graph/badge.svg)](https://app.codecov.io/gh/tidy-intelligence/r-wbwdi)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)




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

`wbwdi` is an R package to access and analyze the World Bank’s World Development Indicators (WDI) using the corresponding [API](https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation). WDI provides more than 24,000 country or region-level indicators for various contexts. `wbwdi` enables users to download, process and work with WDI series across multiple entities and time periods. 

The package is designed to work seamlessly with International Debt Statistics (IDS) provided through the [`wbids`](https://github.com/Teal-Insights/r-wbids) package and shares its syntax with its sibling Python library [`wbwdi`](https://github.com/tidy-intelligence/py-wbwdi). It follows the principles of the [econdataverse](https://www.econdataverse.org/).

This package is a product of Christoph Scheuch and not sponsored by or affiliated with the World Bank in any way, except for the use of the World Bank WDI API.

## Installation

You can install `wbwdi` from CRAN via:

```{r eval=FALSE}
install.packages("wbwdi")
```

You can install the development version of `wbwdi` like this:

```{r eval=FALSE}
pak::pak("tidy-intelligence/r-wbwdi")
```

## Usage

The main function `wdi_get()` provides an interface to download multiple WDI series for multiple entities and specific date ranges. 

```{r}
library(wbwdi)

wdi_get(
  entities = c("MEX", "CAN", "USA"), 
  indicators = c("NY.GDP.PCAP.KD", "SP.POP.TOTL"),
  start_year = 2020, 
  end_year = 2024
)
```

You can also download these indicators for all entities and available dates:

```{r}
wdi_get(
  entities = "all", 
  indicators = c("NY.GDP.PCAP.KD", "SP.POP.TOTL")
)
```

Some indicators are also available on a monthly basis, e.g.:

```{r}
wdi_get(
  entities = "AUT", 
  indicators = "DPANUSSPB",         
  start_year = 2012, 
  end_year = 2015, 
  frequency = "month"
)
```

Similarly, there are also some indicators available on a quarterly frequency, e.g.:

```{r}
wdi_get(
  entities = "NGA", 
  indicators =  "DT.DOD.DECT.CD.TL.US",
  start_year = 2012, 
  end_year = 2015, 
  frequency = "quarter"
)
```

You can get a list of all indicators supported by the WDI API via:

```{r}
wdi_get_indicators()
```

You can get a list of all supported entities via:

```{r}
wdi_get_entities()
```

You can also get the list of supported indicators and entities in another language, but note that not everything seems to be translated into other languages:

```{r, eval=FALSE}
wdi_get_indicators(language = "es")
wdi_get_entities(language = "zh")
```

Check out the following function for a list of supported languages:

```{r}
wdi_get_languages()
```

In addition, you can list supported regions, sources, topics and lending types, respectively:

```{r eval=FALSE}
wdi_get_regions()
wdi_get_sources()
wdi_get_topics()
wdi_get_lending_types()
```

If you want to search for specific keywords among indicators or other data sources, you can use the RStudio or Positron data explorer. Alternatively, this package comes with a helper function:

```{r}
indicators <- wdi_get_indicators()
wdi_search(
  indicators,
  keywords = c("inequality", "gender"),
  columns = c("indicator_name")
)
```

## Relation to Existing R Packages

The most important differences to existing packages are that `wbwdi` is designed to (i) have a narrow focus on World Bank Development Indicators, (ii) have a consistent interface with other R packages (e.g., [`wbids`](https://github.com/Teal-Insights/r-wbids)), (iii) have an MIT license, and (iv) have a shared interface with Python libraries (e.g., [`wbwdi`](https://github.com/tidy-intelligence/py-wbwdi)). `wbwdi` also refrains from using cached data because this approach frequently leads to problems for users due to outdated caches and it uses `httr2` to manage API requests and parse responses. 

More specifically, the differences of existing CRAN releases (apart from interface design) are:

- [`WDI`](https://CRAN.R-project.org/package=WDI): uses cached data by default, does not allow downloading meta data from the WDI API (e.g., languages, sources, topics), has a GPL-3 license, and does neither use `httr` nor `httr2` for requests.
- [`worldbank`](https://CRAN.R-project.org/package=worldbank): does not have a narrow focus because it includes the Poverty and Inequality Platform and Finances One API.
- [`wbstats`](https://CRAN.R-project.org/package=wbstats): uses cached data by default, does not use `httr2`.

Owner

  • Name: Tidy Intelligence
  • Login: tidy-intelligence
  • Kind: organization
  • Email: contact@tidy-intelligence.com
  • Location: Germany

Let your data spark joy (coming soon!)

GitHub Events

Total
  • Create event: 32
  • Release event: 2
  • Issues event: 47
  • Watch event: 5
  • Delete event: 29
  • Issue comment event: 15
  • Push event: 100
  • Pull request event: 51
Last Year
  • Create event: 32
  • Release event: 2
  • Issues event: 47
  • Watch event: 5
  • Delete event: 29
  • Issue comment event: 15
  • Push event: 100
  • Pull request event: 51

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 30
  • Total pull requests: 41
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 0.27
  • Average comments per pull request: 0.51
  • Merged pull requests: 40
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 30
  • Pull requests: 41
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 2 hours
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 0.27
  • Average comments per pull request: 0.51
  • Merged pull requests: 40
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • christophscheuch (30)
  • m-muecke (1)
Pull Request Authors
  • christophscheuch (66)
Top Labels
Issue Labels
enhancement (18) documentation (7) bug (3) release (2)
Pull Request Labels
enhancement (37) documentation (22) release (4) bug (3)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 174 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: wbwdi

Seamless Access to World Bank World Development Indicators (WDI)

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 174 Last month
Rankings
Dependent packages count: 27.1%
Dependent repos count: 33.4%
Average: 49.2%
Downloads: 87.0%
Last synced: 11 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
  • r-lib/actions/setup-tinytex v2 composite
DESCRIPTION cran
  • R >= 4.1 depends
  • cli * imports
  • dplyr >= 1.0.0 imports
  • httr2 >= 1.0.0 imports
  • purrr >= 1.0.0 imports
  • tibble * imports
  • tidyr >= 1.0.0 imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.2.0 suggests
.github/workflows/lint.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite