haversine: haversine function

View source: R/haversine.R

haversineR Documentation

haversine function

Description

function to compute haversine distance based on two GPS coordinates.

Usage

haversine(lat1, lon1, lat2, lon2, r = 6371, units = "km")

Arguments

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"

Details

[fill in details here]

Value

[value]

Examples

haversine(32.301087, -106.747767, 42.381671, -76.382452) # distance traveled from one grad school to another, in km

nsantantonio/fieldMapR documentation built on Feb. 4, 2025, 3:07 a.m.