circAngles {momentuHMM} | R Documentation |
Convert standard direction angles (in radians relative to the x-axis) to turning angle covariates suitable for circular-circular regression on the angle mean
Description
This function can be used to convert angular covariates (e.g., ocean currents, wind direction) measured in radians relative to the x-axis to turning angle
covariates sutiable for circular-circular regression in fitHMM
or MIfitHMM
.
Usage
circAngles(refAngle, data, coordNames = c("x", "y"))
Arguments
refAngle |
Numeric vector of standard direction angles (in radians) relative to the x-axis, where 0 = east, pi/2 = north, pi = west, -pi/2 = south |
data |
data frame containing fields for the x- and y-coordinates (identified by |
coordNames |
Names of the columns of coordinates in |
Value
A vector of turning angles between the movement direction at time step t-1 and refAngle
at time t
Examples
# extract data from momentuHMM example
data<-example$m$data
# generate fake angle covariates
u <- rnorm(nrow(data)) # horizontal component
v <- rnorm(nrow(data)) # vertical component
refAngle <- atan2(v,u)
# add turning angle covariate to data
data$cov3 <- circAngles(refAngle=refAngle,data=data)
[Package momentuHMM version 1.5.5 Index]