Change the baseline scenario in a comparison
Arguments
- x
A
comparison
object.- new_baseline
The name of a
scenario
object contained in thecomparison
which is to be considered the new baseline.
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(
name = "covid19",
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 baseline
sce_set_baseline(
outbreak_comparison, "covid19"
)
#> Scenario comparison object
#> Number of scenarios: 2
#> Baseline scenario: "covid19"
#> Some scenarios have no data, use `run_scenario()` to prepare data
#> Scenario matching variables:
#> No matching variables specified yet.
#> Scenario comparison variables:
#> No comparison variables specified yet.
#> Model functions found:
#> finalsize::final_size