getDist: Calculate the distance between consecutive points

getDistR Documentation

Calculate the distance between consecutive points

Description

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.


popovs/OPPtools documentation built on July 8, 2023, 2:29 a.m.