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

https://github.com/m-muecke/isocountry

R package containing ISO codes for countries and currencies
https://github.com/m-muecke/isocountry

country-codes currency-codes data iso-3166-1 iso-4217 r r-package

Last synced: 2 months ago
JSON representation

R package containing ISO codes for countries and currencies

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%"
)
```

# isocountry

[![R-CMD-check](https://github.com/m-muecke/isocountry/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/m-muecke/isocountry/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/isocountry)](https://CRAN.R-project.org/package=isocountry)

This package contains the following datasets:

- `isocountry`: dataset resulting from merging the [ISO-3166](https://en.wikipedia.org/wiki/ISO_3166-1) and the [UN Region Codes](https://unstats.un.org/unsd/methodology/m49/overview).
- `isocurrency`: [ISO 4217](https://www.iban.com/currency-codes) currency codes combined with [ISO 3166](https://www.iban.com/country-codes) country codes for easy joining.

Package is insipred by the [ISO-3166-Countries-with-Regional-Codes](https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes) project.

## Installation

You can install the released version of **isocountry** from [CRAN](https://CRAN.R-project.org) with:

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

And the development version from [GitHub](https://github.com/) with:

```{r, eval = FALSE}
# install.packages("pak")
pak::pak("m-muecke/isocountry")
```

## Usage

```{r, message = FALSE}
library(dplyr)
library(isocountry)

isocountry |>
left_join(isocurrency, by = join_by(alpha_2 == country_code))
```