% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/precipitation.R
\name{ck_total_precip}
\alias{ck_total_precip}
\title{Total Wet-Day Precipitation (PRCPTOT)}
\usage{
ck_total_precip(precip, dates, period = "annual", wet_day_threshold = 1)
}
\arguments{
\item{precip}{Numeric vector of daily precipitation (mm).}

\item{dates}{Date vector of the same length as \code{precip}.}

\item{period}{Character. Aggregation period: \code{"annual"} (default) or
\code{"monthly"}.}

\item{wet_day_threshold}{Numeric (mm). Days with precipitation
strictly below this threshold are excluded from the sum. Default 1.}
}
\value{
A data frame with columns \code{period}, \code{value}, \code{index}, and \code{unit}.
}
\description{
Annual or monthly total precipitation in wet days, where a wet day is
a day with precipitation at or above \code{wet_day_threshold} mm (default
1 mm, the ETCCDI standard). This is the canonical ETCCDI 'PRCPTOT'
definition (Alexander et al. 2006; Zhang et al. 2011).
}
\details{
Sub-threshold trace amounts are excluded. Pass
\code{wet_day_threshold = 0} to recover the previous behaviour of
summing all daily values.
}
\examples{
dates <- as.Date("2024-01-01") + 0:9
precip <- c(0, 5, 3, 0, 8, 2, 0, 1, 4, 0)
ck_total_precip(precip, dates)
}
