# 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")]
Run the code above in your browser using DataLab