currencyOf | R Documentation |
With specified country name or names, get the associated currency
currencyOf
An object of class list
of length 193.
a list containing all countries and their corresponding currency
# view the searchable countries, return first 6
head(names(currencyOf))
#task 0: check if the currency of spain is included
#should be all in lower case
grep("spain",names(currencyOf), value = TRUE)
#task 1: check the currency of spain
currencyOf$spain
#task 2: check the currency of singapore list
currencyOf$singapore # return a list of singapore
currencyOf$singapore['symbol'] #returns the symbol
currencyOf$singapore['isocode'] #returns the iso code
currencyOf$singapore['fractionalunity'] #returns the fractional unit
#task 3: check currencies of multiple countries
currencyOf[c("slovenia","romania","malaysia")]
#task 4: what if the currency is not available
currencyOf[c("randomcountry","mexico","luxembourg")]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.