Learn R Programming

PupillometryR (version 0.0.5)

detect_blinks_by_size: detect blinks by a change in pupil size

Description

This allows the user to set a threshold for pupil size and remove anything classed as a blink as a result

Usage

detect_blinks_by_size(
  data,
  pupil,
  threshold = 2.5,
  extend_forward = 0,
  extend_back = 0
)

Value

returns dataframe with blinks removed including forward and back, and data in blink column.

Arguments

data

dataset of class PupillometryR

pupil

column name for pupil data

threshold

velocity threshold for blink detection

extend_forward

number of observations to remove forward of blink

extend_back

number of obervations to remove behind blink

Examples

Run this code
Sdata <- make_pupillometryr_data(data = pupil_data,
subject = ID,
trial = Trial,
time = Time,
condition = Type)

Sdata2 <- detect_blinks_by_size(data = Sdata,
pupil = LPupil,
threshold = 2.5,
extend_forward = 0,
extend_back = 0)

Run the code above in your browser using DataLab