tradestatistics (version 4.5.0)

ots_country_code: String matching of official country names and ISO-3 codes according to the United Nations nomenclature

Description

Takes a text string and searches within the package data for a country code in the context of valid API country codes.

Usage

ots_country_code(countryname = NULL)

Value

A single character if there is a exact match (e.g. ots_country_code("Chile")) or a tibble in case of multiple matches (e.g. ots_country_code("Germany"))

Arguments

countryname

A text string such as "Chile", "CHILE" or "CHL".

Examples

Run this code
ots_country_code("Chile ")
ots_country_code("america")
ots_country_code("UNITED  STATES")
ots_country_code(" united_")

Run the code above in your browser using DataLab