View source: R/direction_changes.R
direction_changes | R Documentation |
Checks how often a number sequence changes from decreasing monotonically to increasing monotonically (or vice versa).
direction_changes(numeric_vector)
numeric_vector |
Numbers, ordered by their time of appearance. |
The supplied vectors are assumed to be ordered by time.
Values do not have to be strictly monotonically in-/decreasing.
I.e., c(0, 1, 1, 2)
would return 0,
as x_n >= x_n-1
is satisfied for 2 <= n <= length(c(0, 1, 1, 2))
.
Single number indicating how often numeric_vector
changes direction (0 to +Inf).
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-020-01409-0")}
direction_changes(c(0, 1, 1, 2))
direction_changes(c(0, 1, 1, 0))
direction_changes(c(0, 1, 0, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.