Skip to contents

Convenient wrapper to signal::interp1() for linear interpolation. Assumes that you want interpolated values of xy_old at n_xy_new equidistant data points.

Usage

interp2(time_old, xy_old, n_xy_new = 101)

Arguments

time_old

Timestamps of the xy_old coordinates.

xy_old

To-be normalized x or y coordinates.

n_xy_new

Number of equidistant timepoints that should be generated. Defaults to 101.

Value

Vector of length n_xy_new with interpolated x or y values.

References

Pfister, R., Tonn, S., Schaaf, M., Wirth, R. (2024). mousetRajectory: Mouse tracking analyses for behavioral scientists. The Quantitative Methods for Psychology, 20(3), 217-229. doi:10.20982/tqmp.20.3.p217

Examples

plot(interp2(0:10, (0:10)^2))