Convenient wrapper around `resample_eyetracker`. For provided columns, resamples eyetracker 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_eyetracker_cols(
  df,
  .cols = tidyselect::ends_with("_eye_tracking_data_0"),
  start_resample_col,
  end_resample_col,
  max_duration,
  sample_rate = 10
)

Arguments

df

A trial results data frame.

.cols

Columns containing dataframes to resample. (Default: all eyetracker data). Each data frame must have a column 'time'.

start_resample_col

Column containing start timestamps.

end_resample_col

Column containing end timestamps.

max_duration

Maximum duration of the resample.

sample_rate

New sample rate (Hz).

Value

The data frame with a new columns of resampled movements added, with new column name ending with `_resampled`.