% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/precipitation.R
\name{ck_r95p}
\alias{ck_r95p}
\title{Very Wet Days Total (R95p)}
\usage{
ck_r95p(precip, dates, ref_start = 1961L, ref_end = 1990L, period = "annual")
}
\arguments{
\item{precip}{Numeric vector of daily precipitation (mm).}

\item{dates}{Date vector of the same length as \code{precip}. Must contain
data covering the reference period.}

\item{ref_start, ref_end}{Integer. Reference period boundary years
(inclusive). Defaults to 1961 and 1990.}

\item{period}{Character. Aggregation period: \code{"annual"} (default) or
\code{"monthly"}.}
}
\value{
A data frame with columns \code{period}, \code{value}, \code{index}, and \code{unit}.
}
\description{
ETCCDI canonical index R95p. Annual total precipitation on days where
daily precipitation exceeds the 95th percentile of wet-day precipitation
in a reference period (default 1961 to 1990). A wet day is one with
precipitation at or above 1 mm. The threshold is a single value derived
from all wet days in the reference period (not calendar-day specific).
}
\examples{
set.seed(1)
dates <- seq(as.Date("1961-01-01"), as.Date("1991-12-31"), by = "day")
precip <- pmax(rgamma(length(dates), shape = 0.4, scale = 8) - 1, 0)
tail(ck_r95p(precip, dates))
}
