Description Usage Arguments Value
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.
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"))
|
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" |
A numeric vector of minimum distances for each voter to their nearest drop box or polling location
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.