Learn R Programming

Rnightlights (version 0.2.4)

searchCountry: Search for a country by name or code

Description

Serves as a frontend to the ctryNameToCode and ctryCodeToName functions in one.

Usage

searchCountry(searchTerms, extended = FALSE)

Arguments

searchTerms

The country code/name to search for

extended

Whether to do partial searches

Value

data.frame A mapping of the ctryCode to ctryName if the supplied searchTerm is a ctryCode or vice-versa if the searchTerm was a ctryName

Examples

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

searchCountry("Tanzania") #returns United Republic of Tanzania

searchCountry("uk", TRUE) #returns United Kingdom and Ukraine

searchCountry("rwa", TRUE) #returns Rwanda and Norway

# }

Run the code above in your browser using DataLab