detect_newline: detect_newline

Description Usage Arguments Value Examples

Description

detect_newline can be used to detect the point of a saccade to a new line. Peaks are detected with pracma package

Usage

1
2
detect_newline(x, n_lines, invert = TRUE, samp_rate = 250,
  window = 2, trial_dur = 71, peakheight = 0.5, quiet = F)

Arguments

x

vector of velocities along x coordinate from eye-tracking data of sequential reading

n_lines

the number of lines read by the participant

invert

if true multiplies velocities by -1. If velocity of saccades to new lines is negative (i.e. right to left) this should be used

samp_rate

the sample rate of the eye-tracker used

window

the minimum interval new lines should be detected at. 2 would mean new lines must be at least half of the expected interval.

trial_dur

the duration of the trial in seconds

peakheight

the proportion of the maximum velocity to use as a threshold for peak detection

quiet

if true messages and plots will not be generated

Value

Returns a vector of velocities

Examples

1
2
3
x <- c(replicate(10, sort(runif(100, 0, 500))))
vx <- get_velocity(x)
detect_newline(vx, n_lines = 10, samp_rate = 10, trial_dur = 100)

abeith/eyeCleanR documentation built on June 1, 2019, 12:43 a.m.