Description Usage Arguments Value Examples
View source: R/segmentation_helper_functions.R
Calculates step lengths, turning angles, and net-squared displacement based
on coordinates for each animal ID and calculates time steps based on the
date-time. Provides a self-contained method to calculate these variables
without needing to rely on other R packages (e.g., adehabitatLT
).
However, functions from other packages can also be used to perform this step
in data preparation.
1 | prep_data(dat, coord.names, id)
|
dat |
A data frame that contains a column for animal IDs, the columns
associated with the x and y coordinates, and a column for the date. For
easier interpretation of the model results, it is recommended that
coordinates be stored in a UTM projection (meters) as opposed to
unprojected in decimal degrees (map units). Date-time should be of class
|
coord.names |
character. A vector of the column names under which the coordinates are stored. The name for the x coordinate should be listed first and the name for the y coordinate second. |
id |
character. The name of the column storing the animal IDs. |
A data frame where all original data are returned and new columns are
added for step length (step
), turning angle (angle
),
net-squared displacement (NSD
), and time
step (dt
). Names for coordinates are changed to x
and
y
. Units for step
and NSD
depend on the projection of the
coordinates, angle
is returned in radians, and dt
is
returned in seconds.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.