Skip to contents

Wrapper for raster::pointDistance that only requires input of a vector of longitudes and a vector of latitudes. Default calculation assumes data are in decimal degrees. If not, then set lonlat = FALSE. Compatible with tidyverse.

Usage

getDist(lon, lat, lonlat = TRUE)

Arguments

lon

Vector of longitudes

lat

Vector of latitudes

lonlat

If TRUE, coordinates should be in degrees; else they should represent planar ('Euclidean') space (e.g. units of meters)

Value

A vector of distances in meters.