mousetrack (version 1.0.0)

interpltraj: Get Mouse Dependent Variables

Description

Interpolate a one-dimensional (angle), or two-dimension (x-y) trajectories to a user specified number of time bins.

Usage

interpltraj(x, y, singlepoint, tsmax)

Arguments

x
x-coordinate point of the trajectory
y
y-coordinate point of the trajectory
singlepoint
a logical flag to indicate whether interpolation is done on a single coordinate point (TRUE) or two points (FALSE)
tsmax
the new length of the interpolated trajectory

Value

It returns the interpolated trajectory, either one-dimensional (singlepoint == TRUE), or two-dimensional (singlepoint == FALSE)

References

Spivey, M., Grosjean, M. and Knoblich, G. (2005). Continuous attraction toward phonological competitors. Proceedings of the National Academy of Sciences of the United States of America, 102(29), 10393-10398.

Examples

Run this code

data(mousemove)
x = mousemove$x; y = mousemove$y;
singlepoint = FALSE; tsmax = 101
ans = interpltraj(x, y, singlepoint, tsmax)

str(ans)


Run the code above in your browser using DataCamp Workspace