add_covariates: Covariate Calculations

View source: R/prepare_covariates.R

add_covariatesR Documentation

Covariate Calculations

Description

Add several covariates to movement observations add_covariates add several covariates to a data frame with movement information. It adds : distance between location, spatial angle, speed, smoothed speed, persistence and rotation velocity (calculated with spatial angle).

Usage

add_covariates(x, ...)

## S3 method for class 'Move'
add_covariates(x, coord.names = c("x", "y"), ...)

## S3 method for class 'ltraj'
add_covariates(x, coord.names = c("x", "y"), ...)

## S3 method for class 'data.frame'
add_covariates(
  x,
  coord.names = c("x", "y"),
  smoothed = FALSE,
  timecol = "dateTime",
  units = "hour",
  radius = NULL,
  ...
)

Arguments

x

movement data

...

additional arguments

coord.names

names of coordinates column in x

smoothed

whether speed are smoothed or not

timecol

names of POSIXct time column

units

units for time calculation. Default "hour"

radius

for spatial angle calculations

Value

data.frame with additional covariates

Examples

## Not run: add_covariates(move_object, coord.names = c("x","y"), smoothed = T)
## Not run: 
data(simulmode)
simple_data <- simulmode[,c("dateTime","x","y")]
full_data   <- add_covariates(simple_data, coord.names = c("x","y"),
 timecol = "dateTime",smoothed = TRUE, units ="min")

## End(Not run)

rpatin/segclust2d documentation built on April 24, 2024, 2:22 a.m.