Skip to contents

Update targets in seed or control tables by combining levels for specified geography groups. Use to topcode or aggregate targets for weighting and reporting pipelines.

Usage

update_targets(data, settings, geo_cross_walk, geom = "zone_group")

Arguments

data

data.table with required columns:

  • Target columns prefixed by h_, p_, or t_ (numeric)

  • Geometry column (e.g., zone_group) Rows: one per geography unit. Keys: geometry column. Modified by reference: no (returns copy).

settings

list. Must include:

  • target_updates — named list of updates, each with levels and groups. Modified by reference: no.

geo_cross_walk

data.table with required columns:

  • geom — geometry ID

  • geom_label — geometry label Rows: one per geography unit. Keys: (geom). Modified by reference: no.

geom

character(1). Name of geometry column in geo_cross_walk. Default "zone_group".

Value

data.table with updated targets. Same schema as input, with levels combined as specified.

Details

  • Iterates over target_updates in settings, updating specified targets.

  • Combines levels for selected geography groups using crosswalk.

  • Supports topcoding and aggregation via level lists or mapping tables.

  • Returns a copy; does not modify by reference.

  • Assumes valid target names, levels, and crosswalk schema; errors if missing.

Settings

  • target_updates (direct): List of target updates. Default from settings.

See also

check_group_sum, update_targets, aggregate_targets, create_target_update_table, popsim_make_geoxwalk, popsim_make_input_data, popsim_make_control_config, popsim_calculate_importance, create_importance_list, popsim_settings_defaults, popsim_settings_updates, popsim_make_settings

  • aggregate_targets, create_target_update_table

  • scripts/weighting/update_targets.R

update_targets, aggregate_targets, create_target_update_table

Other weighting pipeline: aggregate_targets(), calc_day_weights(), calc_linked_trip_weights(), calc_person_weights(), calc_sample_plan_counts(), calc_tour_weights(), calc_trip_weights(), create_ie_adjustment_data(), create_target_update_table(), format_income_bins(), get_day_groups(), get_income_broad(), get_income_broad_xwalk(), prepare_zone_groups(), update_daypat_seed(), update_daypat_targets(), update_income_broad_labels(), update_rate_report()

Examples

## Not run:
update_targets(data, settings, geo_cross_walk, geom = "zone_group")
#> Error: object 'settings' not found
## End(Not run)