% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pupil-and-saccade-diagnostics.R
\name{baseline_correct_gazepoint_pupil}
\alias{baseline_correct_gazepoint_pupil}
\title{Baseline-correct Gazepoint pupil size}
\usage{
baseline_correct_gazepoint_pupil(
  dat,
  pupil_col = NULL,
  time_col = "CNT",
  stimulus_onset_col = NULL,
  trial_cols = NULL,
  baseline_window = c(-240, -200),
  baseline_function = c("median", "mean"),
  correction = c("subtract", "divide"),
  suffix = "_baseline_corrected",
  min_baseline_rows = 2,
  overwrite = FALSE
)
}
\arguments{
\item{dat}{A data frame containing pupil-size data.}

\item{pupil_col}{Pupil column. If \code{NULL}, common Gazepoint pupil columns are
detected.}

\item{time_col}{Time column.}

\item{stimulus_onset_col}{Optional stimulus-onset column. If supplied,
baseline windows are interpreted relative to onset.}

\item{trial_cols}{Trial/grouping columns.}

\item{baseline_window}{Numeric vector of length two defining the baseline
window relative to stimulus onset.}

\item{baseline_function}{\code{"median"} or \code{"mean"}.}

\item{correction}{\code{"subtract"} or \code{"divide"}.}

\item{suffix}{Suffix for corrected output column.}

\item{min_baseline_rows}{Minimum finite baseline rows required.}

\item{overwrite}{Logical. If \code{FALSE}, existing output columns are protected.}
}
\value{
A data frame with a corrected pupil column and baseline attributes.
}
\description{
Applies subtractive or divisive baseline correction to pupil-size data within
trials or other grouping units.
}
