track_add_distance: Append the distance between points along a one or more tracks...

View source: R/track.R

track_add_distanceR Documentation

Append the distance between points along a one or more tracks in a data frame

Description

Append the distance between points along a one or more tracks in a data frame

Usage

track_add_distance(
  x,
  by_element = TRUE,
  as_vector = TRUE,
  cumulative = TRUE,
  ...
)

Arguments

x

sf POINT object, with a track column. If the track column is not present one is added.

by_element

logical, defaults to TRUE, see st_distance

as_vector

logical, to return a numeric vector otherwise an units object is returned

cumulative

logical, if TRUE retrieve the cumulative distance. Ignored if as_vector = FALSE

...

other arguments for st_distance

Value

the input sf POINT object with added path_distance variable (column)


BigelowLab/fvcom documentation built on Nov. 8, 2024, 2:24 p.m.