ctryNameToCode: Convert country names to ISO3 codes

Description Usage Arguments Value Examples

View source: R/ctrycode.R

Description

Convert country names to ISO3 codes. Searches the rworldmap map data. With no parameters returns a list of ctryNames and their corresponding codes as given by rworldMap

Usage

1
ctryNameToCode(ctryNames)

Arguments

ctryNames

Character vector common names of countries to convert

Value

Character ISO3 ctryCode if found else NA

Examples

1
2
3
4
5
ctryNameToCode("kenya") #returns "KEN"

ctryNameToCode("ken") #returns "KEN"

ctryNameToCode("jamaica") #returns JAM

chrisvwn/Rnightlights documentation built on Sept. 7, 2021, 1:44 a.m.