% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/temperature.R
\name{ck_heating_degree_days}
\alias{ck_heating_degree_days}
\title{Heating Degree Days}
\usage{
ck_heating_degree_days(tavg, dates, base = 18, period = "annual")
}
\arguments{
\item{tavg}{Numeric vector of daily average temperatures (degrees C).}

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

\item{base}{Numeric. Base temperature in degrees C (default 18).}

\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{
Sum of \code{(base - Tavg)} for all days where daily average temperature is
below the base temperature (default 18 degrees C).
}
\examples{
dates <- as.Date("2024-01-01") + 0:9
tavg <- c(5, 10, 15, 20, 8, 12, 18, 3, 25, 7)
ck_heating_degree_days(tavg, dates)
}
