Convenient wrapper around resample_fruit_task. For provided columns, resamples
fruit task 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".
Returns the data frame with new columns added.
resample_fruit_task_cols(
df,
.cols = tidyselect::contains("_fruittask0.csv_data"),
start_resample_col,
end_resample_col,
max_duration,
sample_rate = 10
)A trial results data frame.
Columns containing dataframes to resample. (Default: all fruit task data). Each data frame must have a column 'time' and a column 'events'.
Column containing start timestamps.
Column containing end timestamps.
Maximum duration of the resample.
New sample rate (Hz).
The data frame with a new columns of resampled movements added, with
new column name ending with _resampled.
See resample_movement_cols for resampling movement or eyetracker data.