timeIn {r2country} | R Documentation |
Fetch the current time in a specific city
Description
Get the current time using specified city name
Usage
timeIn
Format
An object of class list
of length 2226.
Value
a list containing all cities and corresponding local time
Examples
# 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$delhi
#task 2: check the time in Boston
timeIn$boston
#task 3: view the time in multiple countries
timeIn[c("ankara","dubai","ontario")]
#task 4: what if the city is not available
timeIn[c("randomcity","york","jerusalem")]
[Package r2country version 2.0.2.3.1 Index]