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