Creates a new ReplicaGrouper used to generate
synthetic households from an existing synthetic population.
Arguments
- df_synth_pop
A synthetic population stored as a data.frame or
data.table.Each row should represent a single synthetic agent.
- group_by
Character vector specifying the variables used to partition the population during household generation.
Typical examples include:
"neighb_code""sa2_code"Other geographic identifiers
Household generation is performed independently within each grouping combination.
- target_column
Character string identifying the column containing household-position classifications.
Typical values include:
"Parent""Child""SingleAdult"
Defaults to:
"household_position"
Details
The resulting object acts as the top-level coordinator of the
household-generation workflow and manages one or more
ReplicaStructure objects.
The constructor:
Stores the synthetic population.
Stores grouping information.
Initializes the household-type list.
Creates an empty
household_idcolumn if one does not already exist.
Household types are subsequently registered using
renew.
The resulting object is typically executed using
enhance.
Examples
if (FALSE) { # \dontrun{
library(data.table)
pop <- data.table(
agent_id = 1:100,
neighb_code = sample(
c("N1", "N2"),
100,
replace = TRUE
)
)
hg <- ReplicaGrouper(
df_synth_pop = pop,
group_by = "neighb_code"
)
} # }
