% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute.R
\name{ck_compute}
\alias{ck_compute}
\title{Compute a Climate Index by Name}
\usage{
ck_compute(data, index, ...)
}
\arguments{
\item{data}{A named list or data frame containing the required input
vectors. Column names should match function argument names (e.g.
\code{tmin}, \code{tmax}, \code{precip}, \code{dates}).}

\item{index}{Character. Name of the index to compute (e.g.
\code{"frost_days"}). Use \code{\link[=ck_available]{ck_available()}} to see valid names.}

\item{...}{Additional arguments passed to the underlying function (e.g.
\code{period}, \code{threshold}, \code{base}).}
}
\value{
A data frame as returned by the underlying \verb{ck_*} function.
}
\description{
A generic dispatcher that calls the appropriate \verb{ck_*} function based on
a string index name. Useful for programmatic workflows where the index
is selected at runtime.
}
\examples{
d <- data.frame(
  dates = as.Date("2024-01-01") + 0:9,
  tmin = c(-2, 3, -1, 5, -3, 0, 2, -4, 1, -1)
)
ck_compute(d, "frost_days")
}
