% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/heatwave.R
\name{ck_hwd}
\alias{ck_hwd}
\title{Heatwave Duration (HWD)}
\usage{
ck_hwd(tmax, dates, ref_start = 1961L, ref_end = 1990L, min_spell = 3L)
}
\arguments{
\item{tmax}{Numeric vector of daily maximum temperatures (degrees C).}

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

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

\item{min_spell}{Integer. Minimum spell length in days (default 3,
the ET-SCI standard).}
}
\value{
A data frame with columns \code{period}, \code{value}, \code{index}, and \code{unit}.
}
\description{
ET-SCI heatwave family index. Length in days of the longest heatwave
event in each year (see \code{\link[=ck_hwn]{ck_hwn()}} for the heatwave definition).
}
\examples{
set.seed(1)
dates <- seq(as.Date("1961-01-01"), as.Date("1991-12-31"), by = "day")
tmax <- 15 + 10 * sin(2 * pi * as.integer(format(dates, "\%j")) / 365) +
        rnorm(length(dates))
tail(ck_hwd(tmax, dates))
}
