AOI_time {eyetools} | R Documentation |
Time analysis of area of interest entries
Description
Analyses total time on defined AOI regions across trials. Works with fixation and raw data as the input (must use one or the other, not both).
Usage
AOI_time(
data,
data_type = NULL,
AOIs,
AOI_names = NULL,
sample_rate = NULL,
as_prop = FALSE,
trial_time = NULL,
participant_ID = "participant_ID"
)
Arguments
data |
A dataframe of either fixation data (from fix_dispersion) or raw data |
data_type |
Whether data is a fixation ("fix") or raw data ("raw") |
AOIs |
A dataframe of areas of interest (AOIs), with one row per AOI (x, y, width_radius, height). |
AOI_names |
An optional vector of AOI names to replace the default "AOI_1", "AOI_2", etc. |
sample_rate |
Optional sample rate of the eye-tracker (Hz) for use with data. If not supplied, the sample rate will be estimated from the time column and the number of samples. |
as_prop |
whether to return time in AOI as a proportion of the total time of trial |
trial_time |
needed if as_prop is set to TRUE. a vector of the time taken in each trial. Equal to the length of x trials by y participants in the dataset |
participant_ID |
the variable that determines the participant identifier. If no column present, assumes a single participant |
Details
AOI_time can take either single participant data or multiple participants where there is a variable for unique participant identification.
The function looks for an identifier named participant_ID
by default and will treat this as multiple-participant data as default,
if not it is handled as single participant data, or the participant_ID needs to be specified
Value
a dataframe containing the time on the passed AOIs for each trial. One column for each AOI separated by trial.
Examples
data <- combine_eyes(HCL)
fix_d <- fixation_dispersion(data, participant_ID = "pNum")
# fixation data
AOI_time(data = fix_d, data_type = "fix", AOIs = HCL_AOIs, participant_ID = "pNum")
#raw data
AOI_time(data = data, data_type = "raw", AOIs = HCL_AOIs, participant_ID = "pNum")