shg_run: Run a fixed cohort simulation from a config list

View source: R/shg_config.R

shg_runR Documentation

Run a fixed cohort simulation from a config list

Description

shg_run() and SHGInterface$runSim() call the same implementation. Validates required keys and calls runSimFromFixedValues. If repeat, individuals, and N are all omitted, repeat defaults to 1000L. If config is a single string, it is treated as a path and read with read_yaml (use after shg_load_config with the returned list is preferred).

Usage

shg_run(shg, config, attach_run_info = TRUE)

Arguments

shg

An SHGInterface instance.

config

Named list from shg_load_config, or a YAML path.

attach_run_info

If TRUE (default), returns a run bundle list; set to FALSE to return only the simulation data.frame.

Value

If attach_run_info is FALSE, the data.frame from runSimFromFixedValues. If TRUE, a list with four components:

results

Simulation data.frame (see runSimFromFixedValues).

original_config

Intent list passed into the run (cohort scalars, smok_params_source, mort_params_source, mort_params_type, engine options); for runSim/shg_run, the config list or parsed YAML.

repro_config

Effective post-run settings from getReproConfig (resolved segments/threads, RNG, paths, bundle provenance, cohort metadata).

run_info

Execution metadata (UTC time, host, R and package/engine versions; built by internal .shg_build_run_info()).

See Also

shg_load_config, shg_save_config


SmokingHistoryGenerator documentation built on June 13, 2026, 1:08 a.m.