callingCodeOf: Fetch the calling code of a country

callingCodeOfR Documentation

Fetch the calling code of a country

Description

With specified country name or names, get the associated calling code

Usage

callingCodeOf

Format

An object of class list of length 193.

Value

a list containing all countries and their corresponding calling code

Examples

# view the searchable countries, return first 6
head(names(callingCodeOf))

#task 0: check if the calling code of japan is included
#should be all in lower case
grep("japan",names(callingCodeOf), value = TRUE)

#task 1: check the calling code of nigeria
callingCodeOf$nigeria

#task 2: check the calling code of united states
callingCodeOf$`united states`


#task 3: check calling code of multiple countries
callingCodeOf[c("slovenia","romania","malaysia")]

#task 4: what if the calling code is not available
callingCodeOf[c("randomcountry","mexico","luxembourg")]


r2country documentation built on Sept. 11, 2024, 9:24 p.m.