Skip to contents

Function to get haversine distance in meters between two points Based on calculation from the geosphere package

Usage

get_distance_meters(location_1, location_2, radius = 6378137)

Arguments

location_1

A matrix or vector of longitudes and latitudes

location_2

A matrix or vector of longitudes and latitudes

radius

Radius of the sphere to use for haversine calculation (Defaults to meters)

Value

A vector of distances in meters

Examples

get_distance_meters(c(38.8734, -75.2394), c(40.3497, -76.2314))
#> [1] 117610.6