Checks how often a number (relevant_point
) is being
crossed by an number sequence (numeric_vector
).
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
x_vals <- c(-1, 1, -1, 1, -1, 1)
point_crosses(x_vals, 0)
#> [1] 5
point_crosses(x_vals, 1)
#> [1] 0
point_crosses(x_vals, -1)
#> [1] 0