Skip to contents

Function to quickly view the names and types of columns in the scenario outcome data. Operates on the first replicate of each scenario run, and assumes that the outcome data are data.frames.

Usage

sce_peek_outcomes(x, view_rows = FALSE)

Arguments

x

A scenario object with data prepared. Check for whether data has been prepared using sce_has_data().

view_rows

Whether to return the first few rows of the first replicate outcome, using head().

Value

Prints the scenario outcome data's column names and types to screen, or the head() of the first outcome replicate if view_rows = TRUE.

Examples

# create a scenario
scenario_pandemic_flu <- scenario(
  model_function = "finalsize::final_size",
  parameters = make_parameters_finalsize_UK(),
  replicates = 1
)
scenario_pandemic_flu <- run_scenario(scenario_pandemic_flu)

# for column names and types
sce_peek_outcomes(scenario_pandemic_flu)
#>       demo_grp       susc_grp susceptibility     p_infected      replicate 
#>    "character"    "character"      "numeric"      "numeric"      "integer" 
# for data.frame head
sce_peek_outcomes(scenario_pandemic_flu, view_rows = FALSE)
#>       demo_grp       susc_grp susceptibility     p_infected      replicate 
#>    "character"    "character"      "numeric"      "numeric"      "integer"