This 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"
)

Arguments

df

A trial_results data frame.

.cols

A tidy selection of columns to work on. Default: all movement data.

R

A 3 x 3 rotation matrix or reference to column containing rotation matrices Default: no rotation.

offset

A 3-element translation vector in rotated coordinates Default: no translation.

scenario_col

A column containing scenario data. Default: NULL.

scenario_direction

Either "apply" or "undo". Default: "apply".

Value

The trial_results tibble with all selected movement columns reoriented.

Details

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.