Description Usage Arguments Details Value Author(s) Examples
Returns TZ timezone names for each provided location.
1 |
x |
the x coordinates of the locations. Alternatively, an n x 2 matrix or data frame of coordinates or an sp SpatialPoints object. |
y |
the y coordinates of the locations, optional if x is an appropriate structure. |
p4s |
the proj4 string for the coordinates if they are not currently in lat / long. |
use_google |
boolean argumenting indicating if the Google Maps API should be used. |
Given a set of coordinates this functions returns the timezone names for each using either Eric Muller's world timezone shapefile (http://efele.net/maps/tz/world/) or the Google Maps API.
For locations where an approapriate timezone name is not found NA
will be returned.
A vector of timezone names.
Colin Rundel
1 2 3 4 5 6 7 8 9 10 11 | library(lubridate)
cities = data.frame(
City = c("Tokyo", "Shanghai", "New Delhi", "Moscow", "Istanbul", "New York", "London"),
Lat = c(35.685, 31.045, 28.6, 55.752, 41.018, 40.714, 51.514),
Long = c(139.751, 121.399, 77.2, 37.615, 28.964, -74.006, -0.093)
)
(tzs = find_tz(cities$Long, cities$Lat))
lapply(tzs, now)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.