Learn R Programming

Rnightlights (version 0.2.4)

ctryCodeToName: Convert a country ISO3 code to the full name

Description

Convert a country ISO3 code to the full name. Exposes the rworldmap function isoToName(ctryCode). #rworldmap::isoToName can resolve 2-letter ctryCodes but we only want 3-letter ISO3 codes. With no parameters returns a list of ctryCodes and their corresponding names as given by rworldMap::getMap@data

Usage

ctryCodeToName(ctryCodes)

Arguments

ctryCodes

The country Codes to search for

Value

Character The full country name if the ctryCode is found. If ctryCode is not supplied then return a list of all country codes and their corresponding names

Examples

Run this code
# NOT RUN {
ctryCodeToName("KEN") #returns Kenya

ctryCodeToName("ARE") #returns United Arab Emirates

ctryCodeToName("USA") #returns United States of America

ctryCodeToName("JAM") #returns Jamaica

# }

Run the code above in your browser using DataLab