baseline: Baseline correct the data

Description Usage Arguments Value Examples

View source: R/process.R

Description

baseline calculates the average pupil value for the window of Time provided in BaselineWindow. The baseline value is then used in one of three different calculation types that must be specified (Subtraction, Division, or Normalization). Baselining is carried out separately for each event.

Usage

1
2
baseline(data = data, BaselineWindow = 0, BaselineType = NULL,
  DiffBaseOverride = FALSE)

Arguments

data

A data frame object created from downsample.

BaselineWindow

A numeric vector of length 1 or 2 specifying the time points of the baseline window to be examined. Providing two values indicates the start time and the end time of the baseline, respectively. Providing a single value (i.e., time point) assumes that every preceding time point is part of the baseline (N.B. trials may vary in the size of the baseline window and will result in an error).

BaselineType

A character string specifying Subtraction, Division, or Normalization. Subtraction subtracts the average baseline value; Division divides by the average baseline value; and Normalization subtracts and divides by the average baseline value.

DiffBaseOverride

A logical value indicating whether or not to override the error produced when baseline windows differ in size.

Value

An object of type data table as described in tibble.

Examples

1
2
3
4
5
6
7
8
# Load example data
data("Pupilex4")

dat <- baseline(Pupilex4, BaselineWindow = c(-500, 0),
                BaselineType = "Subtraction")

# Please see the vignettes for detailed example usage.
vignette("PupilPre_Basic_Preprocessing", package="PupilPre")

PupilPre documentation built on March 14, 2020, 1:08 a.m.