all_geogs_add_constraint {synthACS} | R Documentation |
Add new constraint to a set of geographies
Description
Add a new constraint to the mapping between a a set of macro datasets and a matching set of micro dataset (supplied as class 'macro_micro'). May be called repeatedly to create a set of constraints across the sub-geographies.
Usage
all_geogs_add_constraint(
attr_name = "variable",
attr_total_list,
macro_micro,
constraint_list_list = NULL
)
Arguments
attr_name |
The name of the attribute, or variable, that you wish to constrain. |
attr_total_list |
A list of named integer vectors containing counts per level of the new constraining attribute for each geography. |
macro_micro |
The geographical dataset of macro and micro data. Should be of class
|
constraint_list_list |
A |
Value
A list of constraint lists.
See Also
Examples
## Not run:
# assumes that micro_synthetic already exists in your environment
# 1. build constraints for gender and age
g <- all_geog_constraint_gender(micro_synthetic, method= "macro.table")
a <- all_geog_constraint_age(micro_synthetic, method= "macro.table")
# 2. bind constraints to geographies and macro-data
cll <- all_geogs_add_constraint(attr_name= "age", attr_total_list= a,
macro_micro= micro_synthetic)
cll <- all_geogs_add_constraint(attr_name= "gender", attr_total_list= g,
macro_micro= micro_synthetic, constraint_list_list= cll)
## End(Not run)
[Package synthACS version 1.7.1 Index]