% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/590_ylt_diagnostics_loss_thresholds.R
\name{ylt_diagnostics_loss_thresholds}
\alias{ylt_diagnostics_loss_thresholds}
\title{Counts number of events per year above loss thresholds}
\usage{
ylt_diagnostics_loss_thresholds(
  longylt,
  lossthresholds,
  maxnumber = 12,
  countequalto = TRUE
)
}
\arguments{
\item{longylt}{A data frame containing the long YLT}

\item{lossthresholds}{A vector of loss thresholds}

\item{maxnumber}{Count up to this number of events}

\item{countequalto}{Logical for how to count}
}
\value{
A matrix (lossthresholds by events) with the counts
}
\description{
Reads in a longylt, and some thresholds, and counts the number of years in which
there are \code{n} or more events exceeding each loss threshold
(think carefully: it's a complicated thing actually).
}
\examples{
#
# 1 create a YLT
#
cat("1. longylt:\n")
year=c(1,1,1,2,2,3,3,4,4,4,5,5,5,5,5)
loss=seq(10,150,10)
longylt=data.frame(year,loss)
print(head(longylt))
#
cat("\n2. calculate results by loss thresholds:\n")
lossthresholds=c(10,30)
maxnumber=3
op=ylt_diagnostics_loss_thresholds(longylt,lossthresholds,maxnumber)
print(op)
}
\author{
Stephen Jewson \email{stephen.jewson@gmail.com}
}
