Prepare Gazepoint AOI sequences
Source:R/prepare_gazepoint_aoi_sequences.R
prepare_gazepoint_aoi_sequences.RdCreate ordered AOI-state sequences from sample-level Gazepoint AOI data or
from the output of summarise_gazepoint_aoi_entries(). The output is
transition-ready and includes the current AOI state, previous state, next
state, dwell time before transition, and self-transition flags.
Usage
prepare_gazepoint_aoi_sequences(
data,
aoi_col = NULL,
time_col = "time",
group_cols = c("subject", "MEDIA_ID", "trial_global"),
include_non_aoi = TRUE,
non_aoi_values = c("non_aoi", "none", "background", "outside", "outside_aoi",
"missing", "missing_aoi"),
missing_aoi_label = "missing_aoi",
include_terminal = TRUE
)Arguments
- data
A Gazepoint sample-level data frame or an AOI-entry table created by
summarise_gazepoint_aoi_entries().- aoi_col
Name of the AOI-state column. Used only when
datais sample-level data. IfNULL, the function triesaoi_current,AOI, andaoi_state.- time_col
Name of the time column, in milliseconds. Used only when
datais sample-level data.- group_cols
Character vector of columns defining independent AOI sequences, usually subject/media/trial.
- include_non_aoi
Logical. If
TRUE, non-AOI/background states are retained. IfFALSE, non-AOI/background states are removed before sequence and transition fields are computed.- non_aoi_values
Character vector of AOI labels treated as background or non-AOI states.
- missing_aoi_label
Label used when the AOI value is missing.
- include_terminal
Logical. If
TRUE, the final state of each sequence is retained withnext_state = NA. IfFALSE, terminal states are removed so that each output row represents an observed transition.