searchCountry: Search for a country by name or code

Description Usage Arguments Value Examples

View source: R/ctrycode.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
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

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