onset_pupil: Zero Time Index to Event Onset

Description Usage Arguments Value

View source: R/onset_pupil.R

Description

Centers the sample index or time stamp of your time series to a reference marker, such that 0 always coincides with the onset of a particular event.

Usage

1
onset_pupil(time, marker, event)

Arguments

time

Numeric vector of sample indices or time stamps corresponding to a single time series.

marker

Vector containing markers of trial events.

event

Label in marker that indicates the onset event to which the time series should be zeroed. If this label is a character string, it must be enclosed in quotation marks.

Value

Numeric vector that zeroes time to the trial onset. In the event that no onset marker is found, a warning is issued and a vector of NAs is returned.


jgeller112/gazer documentation built on Jan. 13, 2020, 1:04 p.m.