haversine | R Documentation |
function to compute haversine distance based on two GPS coordinates.
haversine(lat1, lon1, lat2, lon2, r = 6371, units = "km")
lat1 |
numeric. latitude point 1. |
lon1 |
numeric. longitude point 1. |
lat2 |
numeric. latitude point 2. |
lon2 |
numeric. longitude point 2. |
r |
[value]. Default is 6371 |
units |
units to return. values can be 'km' for kilometers, 'm' for meters, 'mi' for miles, or 'ft' for feet. Default is "km" |
[fill in details here]
[value]
haversine(32.301087, -106.747767, 42.381671, -76.382452) # distance traveled from one grad school to another, in km
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.