% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gsr-eda-helpers.R
\name{summarise_gazepoint_gsr_tonic_phasic}
\alias{summarise_gazepoint_gsr_tonic_phasic}
\title{Summarise tonic and phasic GSR/EDA components}
\usage{
summarise_gazepoint_gsr_tonic_phasic(
  data,
  gsr_col = NULL,
  group_cols = NULL,
  time_col = NULL,
  window_n = 15L,
  peak_threshold = NULL,
  output_prefix = "gsr"
)
}
\arguments{
\item{data}{A data frame.}

\item{gsr_col}{Optional GSR/EDA column. If \code{NULL}, the function prefers
\code{GSR_US}, then \code{GSR}, then other recognised GSR/EDA columns.}

\item{group_cols}{Optional grouping columns. Tonic/phasic values are computed
separately within each group.}

\item{time_col}{Optional time column used to order rows within groups.}

\item{window_n}{Rolling-median window size in samples.}

\item{peak_threshold}{Optional phasic peak threshold. If \code{NULL}, a robust
data-driven threshold is computed within each group as
\code{median(phasic) + 2 * MAD(phasic)}.}

\item{output_prefix}{Prefix for generated columns.}
}
\value{
A list with \code{data}, \code{summary}, and \code{settings}.
}
\description{
Creates a simple descriptive tonic/phasic decomposition of a GSR/EDA signal.
The tonic component is estimated with a rolling median, and the phasic
component is the observed signal minus the rolling-median tonic estimate.
}
\details{
This is a lightweight descriptive helper, not a full skin-conductance-response
deconvolution model. It should be used for quality checks, window summaries,
and exploratory reporting unless a study requires a specialised EDA model.
}
\examples{
df <- data.frame(
  CNT = 1:10,
  GSR_US = c(1, 1.1, 1.0, 1.2, 2.0, 1.3, 1.2, 1.1, 1.0, 1.1)
)
summarise_gazepoint_gsr_tonic_phasic(df, window_n = 3)

}
