get_velocity: get_velocity

Description Usage Arguments Value Examples

Description

get_velocity calculate the velocity of a vector using either the velocity from one point to the next or the method used in the saccades package which calculates velocity based on surrounding points.

Usage

1
get_velocity(x, smooth = 1, method = 1)

Arguments

x

vector of coordinates to calculate velocity between

smooth

number of leading points to smooth velocity by. If smooth = 1 the output will not be smoothed

method

the method to use. 1 is the velocity to the next point, 2 is based on both previous and next point but ignoring current point.

Value

Returns a vector of velocities

Examples

1
2
3
x <- sort(runif(5, 0, 10))
x <- c(x, rev(x))
get_velocity(x)

abeith/eyeCleanR documentation built on June 1, 2019, 12:43 a.m.