add_covariates: Covariate Calculations

Description Usage Arguments Value Examples

View source: R/prepare_covariates.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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

1
2
3
4
5
6
7
8
## 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)

segclust2d documentation built on Oct. 11, 2021, 9:10 a.m.