languageOf {r2country} | R Documentation |
Fetch the official language of a country
Description
With specified country name or names, get the associated official language(s)
Usage
languageOf
Format
An object of class list
of length 193.
Value
a list containing all countries and their corresponding language
Examples
# view the searchable countries, return first 6
head(names(languageOf))
#task 0: check if the language of japan is included
#should be all in lower case
grep("japan",names(languageOf), value = TRUE)
#task 1: check the language of nigeria
languageOf$nigeria
#task 2: check the language of united states
languageOf$`united states`
#task 3: check language of multiple countries
languageOf[c("slovenia","romania","malaysia")]
#task 4: what if the language is not available
languageOf[c("randomcountry","mexico","luxembourg")]
[Package r2country version 2.0.2.3.1 Index]