% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/583_ylt_diagnostics_aaeaal_by_catf.R
\name{ylt_diagnostics_aaeaal_by_catf}
\alias{ylt_diagnostics_aaeaal_by_catf}
\title{Calculates YLT AAE and AAL by Cat}
\usage{
ylt_diagnostics_aaeaal_by_catf(
  longylt,
  nyearsinylt = 0,
  mincat = 999,
  maxcat = 999
)
}
\arguments{
\item{longylt}{A data frame containing the YLT}

\item{nyearsinylt}{The number of years in the YLT.}

\item{mincat}{The minimum cat that is counted}

\item{maxcat}{The maximum cat that is counted}
}
\value{
AAE, AAL, SAE and SAL.
}
\description{
Deals with the number-of-years issue because that's given by the shortylt.
}
\details{
Let me explain mincat and maxcat.
For hurricane the cat column goes from -1 to 5
the code deals with that using dcat
if you specify minc and maxc, then that's what it counts
if you don't specify them, it uses the data
but using the data has the problem that the returned data shape depends on the data
which is really awkward for any further processing
so it's best to specify
}
\examples{
#
# 1 make YLT
#
cat("1. make ylt1:\n")
year=c(1,1,1,2,2,3,3,3)
loss=seq(10,80,10)
cat=c(1,1,1,2,2,3,4,5)
longylt=data.frame(year,loss,cat)
#
# 2 look 
#
op=ylt_diagnostics_aaeaal_by_catf(longylt,mincat=1,maxcat=5)
print(op)
}
\author{
Stephen Jewson \email{stephen.jewson@gmail.com}
}
