Extract ratio of target fixation between a min_time and max_time. You can supply timestamps to min_time and max_time (e.g timestamp of begin escape) to average over only a period, or use the entire duration of the provided data frame.

extract_fixation(
  df,
  target,
  min_time = min(df$time, na.rm = TRUE),
  max_time = max(df$time, na.rm = TRUE)
)

Arguments

df

Eye tracker data frame. Expected columns are time and focus_object_raw.

target

Unity's internal target name (e.g. as returned by find_unity_threat_name

min_time

minimum time in s (default trial start)

max_time

maximum time in s (default trial end)

Value

Ratio of target fixations (0-1), between min_time and max_time.