PupilPre {PupilPre} | R Documentation |
PupilPre: Preprocessing Pupil Size Data.
Description
The PupilPre package provides a set of functions for preparing pupil size data collected with SR Research Eyelink eye trackers.
Processing functions
The function
ppl_prep_data
returns a data table with correctly assigned classes for important columns.The function
ppl_select_recorded_eye
returns a data table with data from the the recorded eye in new columns (IA_ID and IA_LABEL).The function
recode_off_screen
recodes samples with NA if gaze coordinates indicate that the sample was taken while the pupil was off-screen.The function
ppl_rm_extra_DVcols
removes DataViewer coumns that are not necessary for preprocessing with this package.The function
clean_blink
returns a data table for which blinks have been removed based on the parameters provided.The function
clean_artifact
returns a data table for which artifacts have been removed based on the parameters provided.The function
apply_cleanup_change
applies user-selected changes to the automatic cleanup.The function
apply_user_cleanup
returns a data table for which the manually selected artifacts have been removed.The function
rm_sparse_events
removes events that do not contain enough data in the baseline and/or critical windows, as specified by the user.The function
interpolate_NAs
returns a data table in which NAs have been replaced using linear interpolation.The function
apply_butter
applies a Butterworth filter to the pupil size data.The function
trim_filtered
removes a specified number of milliseconds from the beginning and the end of each filtered event, as to remove artifacts created by the filter.The function
downsample
returns a data table for which the data have been downsampled using the specified sampling rate.The function
baseline
returns a data table for which the pupil data have been baselined using the specified method.
Utility functions
The function
ppl_check_eye_recording
returns a summary of whether or not the dataset contains gaze data in both the Right and Left interest area columns.The function
blink_summary
returns a summary of Eyelink marked blinks by Event, Subject, or Item.The function
NA_summary
returns a summary of missing data by Event, Subject, or Item.The function
check_baseline
examines the data within a specified baseline window.The function
compare_summary
returns a summary of comparison between the columns Pupil and Pupil_Previous.
Plotting functions
The function
ppl_plot_avg
returns a plot of the grand or conditional averages of pupil dilation along with error bars.The function
ppl_plot_avg_contour
returns a contour plot of the conditional average of pupil dilation over Time and a specified continuous variable.The function
ppl_plot_avg_cdiff
returns a plot of the average difference between two conditions for pupil dilation with error bars.The function
plot_events
returns image files containing plots for each event by a group and saves into a specified directory.
Interactive functions
The function
user_cleanup_app
opens a Shiny app for identifying and marking datapoints associated with artifacts.The function
plot_summary_app
opens a Shiny app for inspecting by-subject or by-item averages within a specified time window.The function
plot_compare_app
opens a Shiny app for inspecting events for comparing the current pupil column to the previous pupil column.The function
verify_cleanup_app
plots the data points changed during the previously completed auto cleanup, allowing the user to reject the cleanup for specific events.The function
butter_filter_app
produces a plot of filtered pupil data over the original data to visually inspect the effect of different filter settings.
Notes
The vignettes are available via
browseVignettes(package = "PupilPre")
.A list of all available functions is provided in
help(package = "PupilPre")
.This package can be cited using the information obtained from
citation("PupilPre") or print(citation("PupilPre"), bibtex = TRUE)
Author(s)
Aki-Juhani Kyröläinen, Vincent Porretta, Jacolien van Rij, Juhani Järvikivi
Maintainer: Aki-Juhani Kyröläinen, (akkyro@gmail.com)
McMaster University, Canada