Summarise Gazepoint pupil responses within time windows
Source:R/summarise_gazepoint_pupil_windows.R
summarise_gazepoint_pupil_windows.RdAggregates processed Gazepoint pupil data into user-defined analysis windows,
typically after flag_gazepoint_pupil(), interpolate_gazepoint_pupil(),
baseline_correct_gazepoint_pupil(), and smooth_gazepoint_pupil().
The function can summarise raw, interpolated, baseline-corrected,
percent-change, or smoothed pupil columns.
Arguments
- data
A Gazepoint master table or processed pupil table.
- pupil_col
Optional name of the pupil column to summarise. If
NULL, the function detects one ofpupil_smoothed,pupil_baseline_corrected,pupil_baseline_percent_change,pupil_interpolated,pupil_for_preprocessing,mean_pupil,pupil,pupil_raw,left_pupil, orright_pupil.- time_col
Optional name of the time column used for assigning samples to windows. If
NULL, the function detects one oftime_relative_ms,relative_time_ms,event_time_ms,time_ms,time,time_orig, ortime_orig_ms.- windows
Window definitions. Either a numeric vector of breakpoints, such as
c(0, 500, 1000, 2000), or a data frame with window start and end columns. Supported names includewindow_start_ms,window_start,start_ms, orstart, andwindow_end_ms,window_end,end_ms, orend. Awindow_labelorlabelcolumn is optional.- group_cols
Character vector of grouping columns. Standard roles such as
"subject","media_id","trial", and"trial_global"are internally standardised when available. Other columns, such as"condition"or"AOI", can also be used if present indata. Usecharacter(0)for overall window summaries.- include_window_end
Logical. If
FALSE, windows are left-closed and right-open:[start, end). IfTRUE, the end point is included:[start, end]. Defaults toFALSE.- min_valid_samples
Minimum number of finite pupil samples required for a window to be labelled
"valid". Defaults to1.