Eyetracking-R requires that there is a column for each area-of-interest, specifying whether the gaze is within that area for each sample. This function creates an AOI column if needed.

  x_min_col = "L",
  x_max_col = "R",
  y_min_col = "T",
  y_max_col = "B"



Your data


A dataframe specifying the bounding-box for the AOI

x_col, y_col

What are the column names for the x and y coordinates in your dataset?


What is the name of this AOI?

x_min_col, x_max_col

What are the column names for the left and right edge of the AOI-bounding box? Default "L","R"

y_min_col, y_max_col

What are the column names for the top and bottom edge of the AOI-bounding box? Default "T","B"


Dataset with a new column indicating whether gaze is in the AOI


Many eyetracking software packages export your data with a column corresponding to each AOI; however, if your software does not do this, or if you had to define or revise your AOIs after running the experiment, then this function will add the necessary AOI columns for you. The function takes two dataframes: (1) your original data, (2) a dataframe specifying the bounding box for the AOI. The latter can specify a different bounding box for each trial, each subject, each image, or even each video-frame-- anything you like. The two dataframes are simply joined by matching any columns they have in common (case sensitive!), so if there's a unique AOI for each "Trial" in the aoi_dataframe, and there's a "Trial" column in the data dataframe, then the unique AOI coordinates for each trial will be used.