getDist: Calculates the distance between the current location and the...

View source: R/General_Functions.R

getDistR Documentation

Calculates the distance between the current location and the previous location in a track.

Description

Calculates the distance between the current location and the previous location in a track.

Usage

getDist(lon, lat)

Arguments

lon

A vector of longitude values.

lat

A vector of latitude values.

Value

A vector of values (in km) giving the distance between each location in the track and the previous location.

Warning

This function assumes that longitude and latitude values are in chronological order and all values are from a single individual. Make sure that your data are ordered, and use a for loop or some other method to apply this to multiple tracks


allisonglider/seabiRds documentation built on Feb. 14, 2025, 7:37 a.m.