Skip to contents

Check whether a pair of scenarios is comparable

Usage

sce_are_comparable(baseline, compare, match_variables, comparison_variables)

Arguments

baseline

A scenario object.

compare

A second scenario object.

match_variables

A character string of scenario parameter names that is used to check whether the two scenarios have identical parameters or other characteristics (stored in extra_information).

comparison_variables

A character string of column names expected in the scenarios' outcome data. This is used to check whether the scenarios both have the required columns in their data.

Value

A logical value indicating whether a pair of scenarios is comparable.

Examples

# prepare two scenarios of the final size of an epidemic
pandemic_flu <- scenario(
  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
)

# run scenarios to generate data
pandemic_flu <- run_scenario(pandemic_flu)
covid19 <- run_scenario(covid19)

# check whether scenarios are comparable
sce_are_comparable(
  baseline = pandemic_flu,
  compare = covid19,
  match_variables = "demography_vector",
  comparison_variables = "p_infected"
)
#> [1] TRUE