Year loss table in long form
event_set_from_long.RdYears of losses from a year loss table: one row per loss with its year,
from 1 to n_years. Within a year the losses keep their order; years with
no row are empty.
Arguments
- years
The year of each loss, from 1.
- losses
The losses.
- n_years
The number of simulated years, including those with no loss.
- seed
Recorded in results' provenance.
- labels
NULL, or each row's labels aswith_labels()takes them: a named list or data frame with a vector per label dimension, a value per row (list(peril = ..., class = ...)).
Value
An event_set.
Examples
ev <- event_set_from_long(c(3, 1, 3), c(5, 1, 7), 4)
event_counts(ev)
#> [1] 1 0 2 0
ev <- event_set_from_long(c(3, 1, 3), c(5, 1, 7), 4,
labels = list(peril = c("wind", "quake", "wind")))
event_labels(ev, 1)
#> peril
#> 1 quake