adjust_fixation_timing | R Documentation |
Shrink the period classified as a fixation by removing samples close to the onset and offset with excessive differences from the fixation center. This reduces the risk that samples belonging to saccades are misclassified as belonging to a fixation. The function is used internally by other functions and should typically not be called outside of them.
adjust_fixation_timing starts by calculating the median (MD) and MAD of the absolute distances from the fixation center of all included samples. The fixation onset is shifted forwards to the first sample with a distance to the fixation center under t* MAD + MD where t is specified by the input parameter threshold. Analogously, fixation offset is shifted backwards to the last included sample with distance to the fixation center under t* MAD + MD
adjust_fixation_timing(
fixation.candidate.starts,
fixation.candidate.stops,
x,
y,
threshold = 3
)
fixation.candidate.starts |
First row in the data included in the fixation |
fixation.candidate.stops |
Last row in the data included in the fixation |
x |
X coordinates |
y |
Y coordinates |
threshold |
Threshold for highest accepted distance from fixation center in MADs from the median. Default 3. If NA, just remove NAs at the onset and offest of fixation but ignore deviations from fixation center |
data frame with adjusted first and last row of the fixation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.