Learn R Programming

lutz (version 0.1.0)

tz_lookup: Lookup time zones of points

Description

Lookup time zones of points

Usage

tz_lookup(x, crs = NULL)

Arguments

x

either an sfc or sf points or SpatialPoints(DataFrame) object

crs

the coordinate reference system: integer with the EPSG code, or character with proj4string. If not specified (i.e., NULL) and x has no existing crs, EPSG: 4326 is assumed (lat/long).

Value

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

Examples

Run this code
# NOT RUN {
if (require("sf")) {

state_pts <- lapply(seq_along(state.center$x), function(i) {
  st_point(c(state.center$x[i], state.center$y[i]))
})

state_centers_sf <- st_sf(st_sfc(state_pts))

state_centers_sf$tz <- tz_lookup(state_centers_sf)

plot(state_centers_sf[, "tz"])
}

# }

Run the code above in your browser using DataLab