View source: R/pipeline-detransient.R
detransient_pupil | R Documentation |
This function implements transient artifact removal by
identifying and removing samples that exceed a speed-based threshold.
The threshold is computed based on the constant n
, which defaults to
the value 16
.
This function is called by the exposed wrapper detransient()
.
detransient_pupil(x, prev_op, n, mad_thresh)
x |
A data frame containing pupil data with columns |
prev_op |
The name of the previous operation's pupil column |
n |
The constant used to compute the median absolute deviation (MAD)
threshold. Defaults to |
mad_thresh |
The threshold used to identify transient artifacts.
Defaults to |
The function works by:
Calculating the speed of pupil changes using finite differences
Identifying samples that exceed a speed-based threshold
Removing these samples from the pupil data
A numeric vector of the same length as the input data with transient artifacts removed (set to NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.