Skip to contents

The 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.

Usage

with_labels(x, labels)

event_labels(x, sim)

Arguments

x

An event_set.

labels

A named list or data frame with a vector per label dimension, a value per loss, years in order as events() lists them. The names may not be "kind" or "layer".

sim

Year number, from 1 to x@n_sims.

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