Sets the timing variable relative to the onset of an event. See https://dr-jt.github.io/pupillometry/ for more information.

set_timing(
  x,
  onset_message = NULL,
  match = "exact",
  trial_onset.message = NULL,
  pretrial.duration = 0,
  trialonset.message = NULL,
  pre_trial.duration = NULL
)

Arguments

x

dataframe.

onset_message

Message string that marks the start of the event.

match

Is message string an "exact" match or a "pattern" match?

trial_onset.message

deprecated. Use onset_message.

pretrial.duration

deprecated.

trialonset.message

deprecated.

pre_trial.duration

deprecated.

Output

Changes the values in the Time column.

Relative Timing

Raw eye tracker data will provide timing values in absolute values from the start of recording. More useful, are timing values that are relative to the onset of an event.

This function allows you to set the timing variable relative to the onset of an event in the Stimulus or Message columns with the `onset_message` argument call. For instance, you can set the timing relative to the onset of a fixation or the onset of the first stimulus in the trial. You can use this function on the data as many times as you like.