prepData: Preprocessing of the tracking data

View source: R/prepData.R

prepDataR Documentation

Preprocessing of the tracking data

Description

Preprocessing of the tracking data

Usage

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. Tracking data should be structured so that the rows for each track (or each animal) are grouped together, and ordered by date, in the data frame.

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

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"))


moveHMM documentation built on May 31, 2023, 6:13 p.m.