Skip to contents

S3 plotting method for objects of class eyeris. Plots a single-panel timeseries for a subset of the pupil timeseries at each preprocessing step. The intended use of this function is to provide a simple method for qualitatively assessing the consequences of the preprocessing recipe and parameters on the raw pupillary signal.

Usage

# S3 method for class 'eyeris'
plot(
  x,
  ...,
  steps = NULL,
  num_previews = NULL,
  preview_duration = NULL,
  preview_window = NULL,
  seed = NULL
)

Arguments

x

An object of class eyeris derived from load().

...

Additional arguments to be passed to plot.

steps

Which steps to plot; defaults to all (i.e., plot all steps). Otherwise, pass in a vector containing the index of the step(s) you want to plot, with index 1 being the original raw pupil timeseries.

num_previews

Number of random example "epochs" to generate for previewing the effect of each preprocessing step on the pupil timeseries.

preview_duration

Time in seconds of each randomly selected preview.

preview_window

The start and stop raw timestamps used to subset the preprocessed data from each step of the eyeris workflow for visualization. Defaults to NULL, meaning random epochs as defined by num_examples and example_duration will be plotted. To override the random epochs, set example_timelim here to a vector with relative start and stop times (e.g., c(5000, 6000) to indicate the raw data from 5-6 seconds on data that were recorded at 1000 Hz). Note, the start/stop time values indicated here relate to the raw index position of each pupil sample from 1 to n (which will need to be specified manually by the user depending on the sampling rate of the recording; i.e., 5000-6000 for the epoch positioned from 5-6 seconds after the start of the timeseries, sampled at 1000 Hz).

seed

Random seed for current plotting session. Leave NULL to select num_previews number of random preview "epochs" (of preview_duration) each time. Otherwise, choose any seed-integer as you would normally select for base::set.seed(), and you will be able to continue re-plotting the same random example pupil epochs each time – which is helpful when adjusting parameters within and across eyeris workflow steps.

Value

No return value; iteratively plots a subset of the pupil timeseries from each preprocessing step run.

Examples

if (FALSE) { # \dontrun{
# example 1: using the default 10000 to 20000 ms time subset
plot(your_eyeris_data_output_here)

# example 2: using a custom time subset (i.e., 1 to 500 ms)
plot(your_eyeris_data_output_here, preview_window = c(1, 500))
} # }