Description Usage Arguments Value Author(s) References See Also Examples
Given a set of lat-long coordinates for each voter, and a set of coordinates for all drop boxes or polling locations; this function returns a dataframe length data1 (usually voter file), including haversine, mile, and kilometer distance output, as well as any other data2 variables (perhaps address).
1 | smorgesboard(data1, data2 , lat_long1_char, lat_long2_char)
|
data1 |
Dataset, probably a voter file, including lat/long coordinates |
data2 |
Dataset, probably of drop box locations/polling locations, including lat/long coordinates |
lat_long1_char |
Character vector, latitude/longitude column names found in data1 |
lat_long2_char |
Character vector, latitude/longitude column names found in data2 |
A data frame of length data1, with all columns from data2 and distance_haversine, distance_mile, and distance_km appended.
Loren Collingwood <loren.collingwood@ucr.edu>
Haversine: CC Robusto, 1957
dist_km, dist_mile, nearest_dbox
1 2 3 4 5 6 7 | data(meck_ev)
str(voter_meck)
str(early_meck)
# Grab smorgesboard of distance information from polling location
vote_distance <- smorgesboard(voter_meck, early_meck[,-1], c("lat", "long"), c("lat", "long"))
head(vote_distance)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.