Skip to contents

Updates the PopulationSim settings list to include additional geographies and control tables based on project targets. Use when extending PopulationSim to new regions or custom controls.

Usage

popsim_settings_updates(settings, popsim_settings = NULL)

Source

PopulationSim configuration logic and project settings.

Arguments

settings

list. Project settings, must include targets (list of target configs) and optionally popsim_setting_updates (list).

popsim_settings

list or NULL. PopulationSim settings; if NULL, loads defaults.

Value

list. Updated PopulationSim settings including new geographies and control tables.

Details

  • Loads default PopulationSim settings if popsim_settings is NULL.

  • Scans settings$targets for new geographies and adds them to geographies and input_table_list.

    • For each target, adds a control table if not present.

    • Table names: <geo>_control_data, filenames: control_totals_<geo>.csv.

  • Applies manual overrides from settings$popsim_setting_updates if present.

  • Returns the updated settings list for PopulationSim.

  • Assumes input is a list; does not modify by reference.

  • Error handling: checks for NULL and missing keys; no side effects.

Settings

  • targets (direct): list of target configs, each with geography (character).

  • popsim_setting_updates (optional): manual overrides for PopulationSim settings.

See also

popsim_settings_defaults, popsim_make_settings

Other PopulationSim IO: popsim_make_control_config(), popsim_make_geoxwalk(), popsim_make_input_data(), popsim_make_settings(), popsim_make_weights(), popsim_search(), popsim_search_stats()

Examples

## Not run:
updated_settings <- popsim_settings_updates(settings)
#> Error: object 'settings' not found
## End(Not run)