An R package to preprocess pupil data

This package was developed for ease-of-use for researchers that are not experts in either pupillometry or working with data in R. The preprocessing steps can easily be implemented using the pipe operator %>% and a code template is provided: Preprocessing Code (Template) in which preprocessing steps can be modified and/or removed.

This package contains various functions for different steps in the preprocessing pipeline for pupil data. The preprocessing steps are based on current standards such as:

  • deblinking

  • artifact rejection (e.g., MAD)

  • smoothing (low-pass filter)

  • interpolation

  • baseline correction

data_pupil <- pupil_read("folder/file.csv", eyetracker = "eyelink") %>%
  pupil_deblink(extend = 75) %>%
  pupil_artifact(n = 16) %>%
  pupil_smooth(type = "mwa", n = 51) %>%
  pupil_interpolate(type = "linear") %>%
  pupil_baselinecorrect(bc_onset_message = "Stimulus_Onset")
Jason S. Tsukahara
Jason S. Tsukahara
Cognitive Psychologist, PhD

My research focuses on attention control and its role in our mind and life.