-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
63 lines (47 loc) · 2.66 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# whoville <a href='https://github.com/gpw13/whoville'><img src='man/figures/logo.png' align="right" height="139" /></a>
<!-- badges: start -->
[![R build status](https://github.com/gpw13/whoville/workflows/R-CMD-check/badge.svg)](https://github.com/gpw13/whoville/actions)
<!-- badges: end -->
The goal of whoville is to provide a package country reference data published by
the World Health Organization, United Nations and World Bank easily accessible in R.
At the moment, this is a reference dataset and set of functions to work with country
codes and names, allowing easy conversion between names and codes as well as easy
access to region codes, WHO member status, and other published country metadata.
This is used to assist the work of the WHO's Division of Data, Analytics, and
Delivery for Impact's Global Programme of Work 13.
## Functions
Some functions are built to help you turn names or country codes into ISO3 codes:
* `names_to_code()` is the workhorse function that helps match country names and returns standardized country codes.
* `names_to_iso3()` is a wrapper around `names_to_code()` that automatically outputs ISO3 code.
* `codes_to_iso3()` converts other country codes into ISO3 format.
* `valid_codes()` lets you quickly check which country codes in a vector are recognized by the whoville package.
Other functions encourage a tidy R workflow where ISO3 codes are used as the unique identifier for each country:
* `iso3_to_regions()` takes in a vector of ISO3 codes and returns specified region values.
* `iso3_to_codes()` takes in a vector of ISO3 codes and returns specified country codes.
* `iso3_to_names()` takes in a vector of ISO3 codes and returns specified country names.
* `is_who_member()` takes in a vector of ISO3 codes and checks if they are a WHO member state or not.
* `is_oecd_member()` takes in a vector of ISO3 codes and checks if they are an OECD member state or not.
* `is_gbd_high_income()` takes in a vector of ISO3 codes and checks if they are classified as high-income in the 2019 GBD from IHME.
All of these functions are built on top of the `countries` data frame also exported
with the package and developed off of public datasets provided by the World Health
Organization and United Nations. Details available through `?countries`.
## Installation
You can install whoville from Github with:
``` r
devtools::install_github("gpw13/whoville")
```
## Usage
```{r child="vignettes/whoville-usage.Rmd"}
```