Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


servosphereR (version 0.1.1)

calcTurnVelocity: Calculate turn velocity

Description

Calculate the turning velocity in degrees per second between two moves

Usage

calcTurnVelocity(list)

Arguments

list

A list of data frames, where each data frame has a column for turn angle.

Value

A list of data frames that each contain a column for turn velocity.

Details

For this function to work, the data must have previously been processed with the calcTurnAngle function.

This function calculates the turning velocity between two consecutive moves. The units for turn velocity will be degrees per second.

If the data will be aggregated, it is recommended to aggregate the data before running this function.

Examples

Run this code
# NOT RUN {
# Provide data previously processed by the calcTurnAngle function

 servosphere <- list(data.frame(id = rep(1, 200),
                                stimulus = rep(c(0, 1), each = 100),
                                dT = sample(8:12, 200, replace = TRUE),
                                dx = runif(200, 0, 5),
                                dy = runif(200, 0, 5),
                                treatment = rep("a", 200),
                                date = rep("2032018", 200)),
                     data.frame(id = rep(2, 200),
                                stimulus = rep(c(0, 1), each = 100),
                                dT = sample(8:12, 200, replace = TRUE),
                                dx = runif(200, 0, 5),
                                dy = runif(200, 0, 5),
                                treatment = rep("b", 200),
                                date = rep("2032018", 200)))
servosphere <- calcXY(servosphere)
servosphere <- calcBearing(servosphere)
servosphere <- calcTurnAngle(servosphere)
servosphere <- calcTurnVelocity(servosphere)
# }

Run the code above in your browser using DataLab