bin | R Documentation |
This function bins pupillometry data by dividing time into equal intervals and averaging the data within each bin. Unlike downsampling, binning averages data points within each time bin.
bin(eyeris, bins_per_second, method = "mean", call_info = NULL)
eyeris |
An object of class |
bins_per_second |
The number of bins to create per second of data |
method |
The binning method: "mean" (default) or "median" |
call_info |
A list of call information and parameters. If not provided,
it will be generated from the function call. Defaults to |
Binning divides one second of pupillary data into X bins and averages pupillometry data around each bin center. The resulting time points will be: 1/2X, 3/2X, 5/2X, ..., etc. where X is the number of bins per second.
This approach is commonly used in pupillometry research to study temporal dynamics of pupil dilatory response; however, it should be used with caution (as averaging within bins can distort the pupillary dynamics).
An eyeris
object with binned data and updated sampling rate
This function is part of the glassbox()
preprocessing pipeline and is not
intended for direct use in most cases. Provide parameters via
bin = list(...)
.
Advanced users may call it directly if needed.
glassbox()
for the recommended way to run this step as
part of the full eyeris glassbox preprocessing pipeline
downsample()
for downsampling functionality
demo_data <- eyelink_asc_demo_dataset()
# bin data into 10 bins per second using the (default) "mean" method
demo_data |>
eyeris::glassbox(bin = list(bins_per_second = 10, method = "mean")) |>
plot(seed = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.