View source: R/distance_haversine.R
distance_haversine | R Documentation |
compute distance in km between two points: http://en.wikipedia.org/wiki/Haversine_formula
distance_haversine(lat1, lon1, lat2, lon2, r = 6378.137)
lat1 |
latitude of the first geographical location in decimal degrees (WGS84) |
lon1 |
longitude of the first geographical location in decimal degrees (WGS84) |
lat2 |
latitude of the second geographical location in decimal degrees (WGS84) |
lon2 |
longitude of the second geographical location in decimal degrees (WGS84) |
r |
earth diameter at the equator in km |
a numeric value of the distance between the two points in km
distance_haversine(43.5279, 1.5009, 42.8504, -0.4333)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.