% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/temperature.R
\name{ck_tn90p}
\alias{ck_tn90p}
\title{Percentage of Warm Nights (TN90p)}
\usage{
ck_tn90p(
  tmin,
  dates,
  ref_start = 1961L,
  ref_end = 1990L,
  period = "annual",
  bootstrap = FALSE
)
}
\arguments{
\item{tmin}{Numeric vector of daily minimum 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{period}{Character. Aggregation period: \code{"annual"} (default) or
\code{"monthly"}.}

\item{bootstrap}{Logical. If \code{TRUE}, apply the Zhang (2005) in-base
bootstrap correction. Default \code{FALSE} for backward compatibility
and speed.}
}
\value{
A data frame with columns \code{period}, \code{value}, \code{index}, and \code{unit}.
}
\description{
ETCCDI canonical index TN90p. Percentage of days where daily Tmin
exceeds the 90th percentile of the calendar-day distribution from a
reference period (default 1961 to 1990). Computation follows the
same convention as \code{\link[=ck_tx10p]{ck_tx10p()}} and supports the same \code{bootstrap}
argument.
}
\examples{
set.seed(1)
dates <- seq(as.Date("1961-01-01"), as.Date("1991-12-31"), by = "day")
tmin <- 5 + 8 * sin(2 * pi * as.integer(format(dates, "\%j")) / 365) +
        rnorm(length(dates))
tail(ck_tn90p(tmin, dates))
}
