interpolate_looks: AOI-based gaze interpolation

Description Usage Arguments Details

View source: R/interpolation.R

Description

Fills in windows of missing data if the same AOI is fixated at beginning and end of the missing data window. For example, the sequence "Target", NA, NA, "Target" would be interpolated to be "Target", "Target", "Target", "Target".

Usage

1
2
3
4
5
6
7
8
9
interpolate_looks(
  x,
  window,
  fps,
  response_col,
  interp_col,
  fillable,
  missing_looks
)

Arguments

x

a dataframe of grouped eyetracking data. Each row should be a single frame of eyetracking. Use dplyr::group_by() to set the grouping columns for the data. The groups should specify a single trial of eyetracking data.

window

maximum amount of missing data (milliseconds) that can be interpolated. Only spans of missing data with less than or equal to this duration will be interpolated

fps

number of eyetracking frames (dataframe rows) per second

response_col

name of the column with the eyetracking response data

interp_col

name of a column to add to the dataframe. This column records whether each frame was interpolated (TRUE) or not (FALSE)

fillable

values in the response column where interpolation is legal. These would typically be AOI locations.

missing_looks

values that can be imputed

Details

Use window to constrain the duration of missing data windows that can be filled. We conventionally use 150ms because we would not expect someone to shift their gaze from Image A to Image B to Image A in that amount of time.


tjmahr/littlelisteners documentation built on June 3, 2021, 2:10 p.m.