point_crosses {mousetRajectory} | R Documentation |
Number of times a point is crossed
Description
Checks how often a number (relevant_point
) is being
crossed by an number sequence (numeric_vector
).
Usage
point_crosses(numeric_vector, relevant_point = 0)
Arguments
numeric_vector |
Numbers, ordered by their time of appearance. |
relevant_point |
Number which has to be crossed. |
Details
The supplied vectors are assumed to be ordered by time.
Value
Number of times that numeric_vector
crosses
the relevant_point
(0 to +Inf).
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. doi:10.3758/s13428-020-01409-0
Examples
x_vals <- c(-1, 1, -1, 1, -1, 1)
point_crosses(x_vals, 0)
point_crosses(x_vals, 1)
point_crosses(x_vals, -1)
[Package mousetRajectory version 0.2.1 Index]