population_gen | R Documentation |
Generate population data (X in standart notation) from a population object.
population_gen(population, seed = NULL, class = TRUE)
population |
Input population configuration |
seed |
The seed to be set before attempting to generate population data. Defaults to NULL. |
class |
Logical. Indicates whether or not to include individual class information to the resulting data.frame. Defaults to NULL. |
data.frame A data.frame (X) with simulated population (one row per individual).
# Create individuals ind1 <- individual$new() ind1$add_characteristics(Age = rnorm(mean = 40, sd = 10)) ind1$add_decision_rule(drule <- decision_rule$new()) ind2 <- individual$new() ind2$add_characteristics(Age = rnorm(mean = 30, sd = 5)) ind2$add_decision_rule(drule <- decision_rule$new()) # Regroup individuals into population pop <- population$new(profiles = list(ind1, ind2), n = list(10, 15)) X <- population_gen(pop)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.