tz_lookup_coords: Lookup time zones of lat/long pairs

View source: R/tz_lookup.R

tz_lookup_coordsR Documentation

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 documentation built on Oct. 18, 2023, 1:17 a.m.