R/processing_trial_functions.R
reorient_movement_cols.RdThis is a wrapper function for reorient_movement. See there for details.
Applies the same affine transformation to selected movement data columns
within each row of a trial results data frame.
reorient_movement_cols(
df,
.cols = tidyselect::ends_with("_movement_data_0") & !(tidyselect::starts_with("valid")),
R = diag(3),
offset = c(0, 0, 0),
scenario_col = NULL,
scenario_direction = "apply"
)A trial_results data frame.
A tidy selection of columns to work on. Default: all movement data.
A 3 x 3 rotation matrix or reference to column containing rotation matrices Default: no rotation.
A 3-element translation vector in rotated coordinates Default: no translation.
A column containing scenario data. Default: NULL.
Either "apply" or "undo". Default: "apply".
The trial_results tibble with all selected movement columns reoriented.
If scenario_col is provided, the corresponding scenario data are passed to
reorient_movement for each row. This can be used to apply or undo scenario
position and rotation transformations.