Description Usage Arguments Value Examples
detect_newline
can be used to detect the point of a saccade to a new line. Peaks are detected with pracma package
1 2 | detect_newline(x, n_lines, invert = TRUE, samp_rate = 250,
window = 2, trial_dur = 71, peakheight = 0.5, quiet = F)
|
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 |
Returns a vector of velocities
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.