# view the searchable cities, return first 10
names(timeIn)[1:10]
#task 0: check if the time in Delhi is present
#should be all in lower case
grep("delhi",names(timeIn), value = TRUE)
#task 1: check the time in delhi
timeIn$`india, delhi, new delhi`
#task 2: check the time in Boston
timeIn$`usa, massachusetts, boston`
#task 3: view the time in multiple countries
timeIn[c(
"china, zhejiang, hangzhou",
"nigeria, kano, kano",
"usa, texas, garland"
)]
#task 4: what if the city is not available
timeIn[c("randomcity","york","jerusalem")]
Run the code above in your browser using DataLab