% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/801_hours_clause.R
\name{hours_clause}
\alias{hours_clause}
\title{Applies an hours clause to a long YLT, and returns a YLT}
\usage{
hours_clause(
  longylt1,
  hcdays,
  hckm,
  byregion = FALSE,
  rust,
  rrrr,
  verbose = FALSE
)
}
\arguments{
\item{longylt1}{The input long YLT}

\item{hcdays}{Hours clause parameter, number of days}

\item{hckm}{Hours clause parameter, distance in km}

\item{byregion}{Whether to use regions, or distances, to measure closeness}

\item{rust}{Rust logical}

\item{rrrr}{R logical}

\item{verbose}{Logical, meaning obvious}
}
\value{
A long YLT with hours clause applied.
}
\description{
I could simplify the code by just returning a long YLT,
and then leaving the user to create a short YLT using long2short.
}
\details{
Can be called from \code{hours_clause_wrapper}, which manages the file i/o.
Note that exactly what 'applying an hours clause' means some explanation.
We don't have access to footprints, just days of the year (one day per event)
and locations (one point per event). The algorithm looks at the days and
the locations and merges events which are close in both time and space. It only
applies a maximum of one hours clause per year, which is chosen to give the
maximum possible event loss (i.e., the largest possible max loss recovery
for the cedant).
}
\examples{
#
# 1 set the hours clause settings
#
hcdays=15
hckm=200
#
# 2 make an 8 year ylt with 10 events
#
cat("1. make longylt:\n")
nyearsinylt=8
year	=c(1	,1	,1	,2	,4	,5	,6	,7	,8	,8)
day		=c(1	,2	,51	,101,151,201,251,300,350,360)
evid	=c(1	,2	,3	,4	,5	,6	,7	,8	,9	,10)
lat		=c(10	,11	,30	,30	,30	,30	,30	,30	,30	,50)	
lon		=c(10	,11	,30	,30	,30	,30	,30	,30	,30	,50)	
loss	=seq(10,55,5)
longylt1=data.frame(year,day,evid,lat,lon,loss)
#
# 3 apply the hours clause and generate a new ylt
#
longylt2=hours_clause(longylt1,hcdays,hckm,rust=FALSE,rrrr=TRUE,verbose=TRUE)
#
print(head(longylt1,n=10))
print(head(longylt2,n=10))
#
}
\author{
Stephen Jewson \email{stephen.jewson@gmail.com}
}
