View source: R/sim_anneal_wrappers.R
all_geogs_add_constraint | R Documentation |
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.
all_geogs_add_constraint( attr_name = "variable", attr_total_list, macro_micro, constraint_list_list = NULL )
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 |
A list of constraint lists.
add_constraint
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.