rubitCalcActivity: Calculates the frequency and duration of mobile / stationary...

Description Usage Arguments Value See Also Examples

View source: R/calcActivity.R

Description

Defines stationary and mobile phases by determining the number of consecutive timepoints in which movement speeds are below (stationary; FALSE) or above (mobile; TRUE) a speed threshold, min_speed. The window size, window, defines the number of consecutive timepoints required to change the activity phase, in seconds.

Usage

1
rubitCalcActivity(m, window = 1, min_speed = 0.1, simple = FALSE)

Arguments

m

a matrix containing processed tracking data outputted by rubitBasic

window

the window size used to define changes in activity, in seconds.

min_speed

the minimum speed threshold used to define changes in activity below which no movement is inferred, in mm/second.

simple

logical; if FALSE, more complex information on average distance, velocity and position is returned for individual runs.

Value

A new matrix containing information on runs for the inputted area.

See Also

rubitMetrics to understand the different steps of processing. This function uses the run length encoding function, rle(), from base R.

Examples

1
2
3
4
data(tenebrio_basic)

### Apply the function over all areas in list
sapply(tenebrio_basic, rubitCalcActivity, window = 3, simple = TRUE)

JoGall/rubitrail documentation built on May 7, 2019, 10:53 a.m.