Learn R Programming

Rnightlights (version 0.1.2)

ctryNameToCode: Convert a country name to its ISO3 code

Description

Convert a country name to its ISO3 code. Exposes the rworldmap function rwmGetISO3(ctryName). See the examples. With no parameters returns a list of ctryNames and their corresponding codes as given by rworldMap

Usage

ctryNameToCode(ctryName)

Arguments

ctryName

Chracter string common name of a country

Value

Character ISO3 ctryCode if found else NA

Examples

Run this code
# NOT RUN {
ctryNameToCode("kenya")
  #returns "KEN"

ctryNameToCode("ken")
  #returns "KEN"
  
ctryNameToCode("jamaica") #returns JAM



# }

Run the code above in your browser using DataLab