Set scenario names in a comparison object.
Arguments
- x
A
comparison
object.- old_names
A character vector of the names of the scenarios in this comparison object, which are to be replaced.
- new_names
A character vector of the names with which to replace the names given in
old_names
.- new_baseline
Optional. The name of the new baseline scenario, if this has been changed. The old baseline is retained if this argument is missing.
Examples
# create some scenarios
pandemic_flu <- scenario(
name = "pandemic_flu",
model_function = "finalsize::final_size",
parameters = make_parameters_finalsize_UK(r0 = 1.5),
replicates = 1L
)
covid19 <- scenario(
model_function = "finalsize::final_size",
parameters = make_parameters_finalsize_UK(r0 = 5.0),
replicates = 1L
)
# create comparison, passing prepared scenarios with some names
outbreak_comparison <- comparison(
pandemic_flu, covid19,
baseline = "pandemic_flu"
)
# change all names to upper case
outbreak_comparison <- sce_set_scenario_names(
x = outbreak_comparison,
old_names = "pandemic_flu",
new_names = "Influenza",
new_baseline = "Influenza"
)