Label the events
with_labels.RdThe same events with labels, a peril or a class say. apply_tower() then
gives gross, each layer's ceded loss and net by label, with the label
dimensions after kind and layer; merge_event_sets() keeps the labels
of either set. Replaces any labels the set had.
Value
with_labels(): an event_set (its label_dims property names
the dimensions and label_combinations is a data frame of the distinct
combinations, sorted). event_labels(): a data frame of year sim's
labels, a row per loss, or NULL when the events carry none.
Examples
ev <- with_labels(events_from_years(list(c(5, 2), 9)), list(peril = c("wind", "flood", "wind")))
ev@label_combinations
#> peril
#> 1 flood
#> 2 wind
event_labels(ev, 1)
#> peril
#> 1 wind
#> 2 flood