get_timezone uses the lutz package to lookup the timezone of locations from lat/lng coords. See lutz::tz_lookup_coords for more details.
Arguments
- lng, lat
Numeric longitude/latitude pairs (decimal degrees).
- method
either "accurate" or "fast", indicating the lookup method to use. See lutz::tz_lookup_coords for more details. Set
.quiettoTRUEto suppress warning produced whenmethod = "fast".- quiet
A logical value indicating if messages and warnings should be suppressed.
- ...
Additional parameters to pass to lutz::tz_lookup_coords (currently unused)
Value
a character vector with the same length as lat and lng indicating each locations likely timezone.
See lutz::tz_lookup_coords for more details.
Examples
get_timezone(lng = -105.053144, lat = 69.116178, method = "accurate")
#> [1] "America/Cambridge_Bay"
get_timezone(lng = c(-105.053144, -106.053144), lat = c(69.116178, 49.116178), method = "fast")
#> Warning: Using 'fast' method. This can cause inaccuracies in time zones
#> near boundaries away from populated ares. Use the 'accurate'
#> method if accuracy is more important than speed.
#> [1] "America/Cambridge_Bay" "America/Regina"