Downsample gaze data

Description

This function combines gaze samples into time bins and optionally aggregates the data.

Usage

downsample_gaze(
  dataframe,
  bin.length = 50,
  timevar = "time",
  aggvars = c("subject", "condition", "target", "trial", "object", "time_bin")
)

Arguments

dataframe DataFrame containing gaze data.
bin.length Length of time bins (in milliseconds).
timevar Column name representing time.
aggvars Vector of variable names to group by for aggregation. Use "none" to skip aggregation.

Value

DataFrame with time bins added and optionally aggregated data.