Learn R Programming

mousetRajectory (version 0.2.1)

interp2: Interpolation aka Time-Normalization

Description

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)

Value

Vector of length n_xy_new with interpolated x or y values.

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.

References

Wirth, R., Foerster, A., Kunde, W., & Pfister, R. (2020). Design choices: Empirical recommendations for designing two-dimensional finger tracking experiments. Behavior Research Methods, 52, 2394 - 2416. tools:::Rd_expr_doi("10.3758/s13428-020-01409-0")

Examples

Run this code
plot(interp2(0:10, (0:10)^2))

Run the code above in your browser using DataLab