Description Usage Arguments Value Examples
Great circle shortest distances in kilometres between two sets of points on the globe, or distances between all pairs of locations
1 2 3 | geo_dist(lat1, lon1, lat2, lon2)
geo_dist_pairwise(lat1, lon1, lat2 = lat1, lon2 = lon1)
|
lat1, lon1 |
Coordinates of origins in decimal degrees |
lat2, lon2 |
Coordinates of destinations in decimal degrees |
A numeric vector of distances, in kilometers, or a matrix of such distances
1 2 3 4 | Cns_Bris_Syd_Mel <- data.frame(lat = c(-16.9186, -27.4698, -33.8688, -37.8136),
lon = c(145.7781, 153.0251, 151.2093, 144.9631))
with(Cns_Bris_Syd_Mel, geo_dist(lat[1], lon[1], lat[-1], lon[-1]))
with(Cns_Bris_Syd_Mel, geo_dist_pairwise(lat, lon))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.