Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tz_lookup_coords

Lookup time zones of lat/long pairs


Description

There are two methods - "fast", and "accurate". The "fast" version can look up many thousands of points very quickly, however when a point is near a time zone boundary and not near a populated centre, it may return the incorrect time zone. If accuracy is more important than speed, use method = "accurate".

Usage

tz_lookup_coords(lat, lon, method = "fast", warn = TRUE)

Arguments

lat

numeric vector of latitudes

lon

numeric vector of longitudes the same length as x

method

method by which to do the lookup. Either "fast" (default) or "accurate".

warn

By default, if method = "fast" a warning is issued about the potential for inaccurate results. Set warn to FALSE to turn this off.

Value

character vector the same length as x and y specifying the time zone of the points.

Examples

tz_lookup_coords(42, -123)
tz_lookup_coords(lat = c(48.9, 38.5, 63.1, -25), lon = c(-123.5, -110.2, -95.0, 130))

lutz

Look Up Time Zones of Point Coordinates

v0.3.1
MIT + file LICENSE
Authors
Andy Teucher [aut, cre] (<https://orcid.org/0000-0002-7840-692X>), Bob Rudis [ctb] (<https://orcid.org/0000-0001-5670-2640>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.