prepData: Preprocessing of the tracking data

Description Usage Arguments Value Examples

View source: R/prepData.R

Description

Preprocessing of the tracking data

Usage

1
2
prepData(trackData, type = c("LL", "UTM"), coordNames = c("x", "y"),
  LLangle = NULL)

Arguments

trackData

A dataframe of the tracking data, including at least coordinates (either longitude/latitude values or cartesian coordinates), and optionnaly a field ID (identifiers for the observed individuals). Additionnal fields are considered as covariates. Note that, if the names of the coordinates are not "x" and "y", the coordNames argument should specified.

type

'LL' if longitude/latitude provided (default), 'UTM' if easting/northing.

coordNames

Names of the columns of coordinates in the data frame. Default: c("x","y").

LLangle

Logical. If TRUE, the turning angle is calculated with geosphere::bearing (default), else calculated with atan2.

Value

An object moveData, i.e. a dataframe of:

ID

The ID(s) of the observed animal(s)

step

The step lengths - in kilometers if longitude/latitude provided, and in the metrics of the data otherwise

angle

The turning angles (if any) - in radians

x

Either Easting or longitude (or e.g. depth for 1D data)

y

Either Northing or latitude (all zero if 1D data)

...

Covariates (if any)

Examples

1
2
3
4
coord1 <- c(1,2,3,4,5,6,7,8,9,10)
coord2 <- c(1,1,1,2,2,2,1,1,1,2)
trackData <- data.frame(coord1=coord1,coord2=coord2)
d <- prepData(trackData,type='UTM',coordNames=c("coord1","coord2"))

TheoMichelot/moveHMM documentation built on June 5, 2018, 12:15 p.m.