% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functional_dsp.R
\name{functional_summary}
\alias{functional_summary}
\title{Summarize Disease Suppression Profiles}
\usage{
functional_summary(
  object,
  time = "time",
  response = "DSP",
  treatment = "treatment",
  group = NULL,
  threshold = 0,
  positive_only = TRUE
)
}
\arguments{
\item{object}{An object of class \code{"functional_dsp"} or a data frame with a DSP column.}

\item{time}{Character string naming the time column.}

\item{response}{Character string naming the DSP column.}

\item{treatment}{Character string naming the treatment column.}

\item{group}{Optional character vector of grouping variables.}

\item{threshold}{Numeric; minimum suppression threshold for calculating persistence. Default is 0.}

\item{positive_only}{Logical; if \code{TRUE}, negative DSP values are set to 0 before area/centroid calculations. Default is \code{TRUE}.}
}
\value{
A \code{tibble} with one row per group/treatment containing:
\itemize{
\item \code{protected_area}: Trapezoidal integral of DSP(t).
\item \code{mean_suppression}: Temporal mean of DSP(t).
\item \code{max_suppression}: Maximum value of DSP(t).
\item \code{time_max_suppression}: Time at which maximum suppression occurs.
\item \code{persistence}: Total duration where DSP(t) > threshold.
\item \code{centroid}: Temporal centroid defined as \eqn{\int t \cdot DSP(t) dt / \int DSP(t) dt}.
\item \code{energy}: Integral of \eqn{DSP(t)^2}.
\item \code{early_area, mid_area, late_area}: Protected area in the first, second, and third tertiles of the time period.
\item \code{late_decline_slope}: Slope of DSP(t) in the late period.
\item \code{n_time_points}: Number of time points evaluated.
}
}
\description{
Extracts functional descriptors from Disease Suppression Profiles (DSPs).
}
\examples{
\dontrun{
# Using a generic data frame with custom column names
dat <- data.frame(
  DAA = c(0, 10, 20),
  fungicide = c("A", "A", "A"),
  contrast = c(0, 10, 0)
)
functional_summary(
  dat, 
  time = "DAA", 
  response = "contrast", 
  treatment = "fungicide"
)
}

}
