add_set_vels: Add Velocity Timeseries

View source: R/velocities.R

add_set_velsR Documentation

Add Velocity Timeseries

Description

This function calculates the headings and speeds of individuals based on two location points and the time taken to travel between those points.

Usage

add_set_vels(
  data,
  geo = FALSE,
  verbose = FALSE,
  parallelize = FALSE,
  independent_call = TRUE
)

Arguments

data

A dataframe with the time series of individuals' positions. Columns must include: t, id, x, y.

geo

Logical, whether positions are geographic coordinates, default = TRUE.

verbose

Logical, whether to post updates on progress, default = FALSE.

parallelize

Logical, whether to run the function in parallel, default = FALSE.

independent_call

Logical, whether the function is called by itself or as part of the package pipeline (through add_velocities). The default is set to TRUE, reflecting the direct call of the function by the user.

Value

The input dataframe with a new speed and heading (rotational, in rads) columns.

Author(s)

Marina Papadopoulou m.papadopoulou.rug@gmail.com

See Also

add_velocities

Examples


data <- data.frame(
x = rnorm(25, sd = 3),
y = rnorm(25, sd = 3),
t = as.POSIXct(1:25, origin = Sys.time()),
id = rep(1, 25)
)

data <- add_set_vels(data, geo = FALSE)


swaRmverse documentation built on Oct. 10, 2024, 5:08 p.m.