calculate_mvt: A function to calculate movement metrics for each trajectory

Description Usage Arguments Value

View source: R/Calculate_mvt.R

Description

The function takes the X- and Y-coordinates for each unqiue trajectory and calculates movement metrics such as the gross and net displacement, absolute and relative angles and duration

Usage

1
calculate_mvt(data, to.data, trajectory.data.folder, pixel_to_scale, fps)

Arguments

data

dataframe containing the X- and Y-coordinates, the frame and the trajectory ID

to.data

path to the working directory

trajectory.data.folder

directory where the data is saved

pixel_to_scale

specify how a pixel scales to real dimensions

fps

specify the frame rate of the video

Value

returns a data.table with the movement metrics for each fix appended to the original data (NB: movement metrics often need two (e.g. step length), sometimes even three (e.g., turning angles) fixes; fixes for which metrics cannot be calculated are padded with NA). The movement parameters are the step length, the step duration, the step speed (step length/step duration), the gross displacement as the cumulative sum of the step lengths, the net displacement between the first fix of a given trajectory and the current fix and finally the relative angle (turning angle) and absolute angle (in radians). For details on these metrics, please refer to a dedicated textbook (e.g. Turch (1998): Quantitative Analysis of Movement: Measuring and Modeling Population Redistribution in Animals and Plants, Sinauer Associates, Sunderland).


pennekampster/bemovi documentation built on May 25, 2019, 12:46 a.m.