nearest_dbox2: Nearest Dbox

Description Usage Arguments Value

Description

Given a set of lat-long coordinates for each voter, and a set of coordinates for all drop boxes or polling locations, nearest_dbox2() calculates the nearest drop box or polling location for each voter, in miles or minutes.

Usage

1
2
3
nearest_dbox2(lat1d_vec, lon1d_vec, lat2d_vec, lon2d_vec, mode = c("driving",
  "transit", "walking", "bicycling"), value = c("distance_m", "distance_text",
  "duration_s", "duration_text"))

Arguments

lat1d_vec

Numeric vector, latitude coordinate of voter

lon1d_vec

Numeric vector, longitude coordinate of voter

lat2d_vec

Numeric vector, latitude coordinate of drop box, polling location

lon2d_vec

Numeric vector, longitude coordinate of drop box, polling location

mode

Travel mode, one of: "driving" (default), "transit", "walking", "bicycling"

value

to extract, one of: "distance_m" (default), "distance_text", "duration_s","duration_text"

Value

A numeric vector of minimum distances for each voter to their nearest drop box or polling location


sgrav007/mapupgrade documentation built on May 21, 2019, 12:22 p.m.