Convenient wrapper around `resample_movement`. For provided columns, resamples movement dataframes contained in the columns between times stored in `start_resample_col` and `end_resample_col`. Resampling is done up to a max duration of `max_duration` with a sample rate `sample_rate`. Non-existing time points for any trial are filled with "NA". Position values will be reoriented to reference position if given. Returns the data frame with new columns added.
resample_movement_cols(
df,
.cols = tidyselect::ends_with("_movement_data_0") & !(tidyselect::starts_with("valid")),
start_resample_col,
end_resample_col,
max_duration,
sample_rate = 10,
ref_pos_col = c()
)
A trial results data frame.
Columns containing dataframes to resample. (Default: all movement data). Each data frame must have a column 'time'.
Column containing start timestamps.
Column containing end timestamps.
Maximum duration of the resample.
New sample rate (Hz).
Column containing reference position (e.g. fruit picking position), default is relative to origin (i.e. just resample, no translation)
The data frame with a new columns of resampled movements added, with new column name ending with `_resampled`.
To resample fruit collection and eyetracker data, see `resample_fruit_task_cols` and `resample_eyetracker_cols`.