R/slimr_blocks.R
slim_block_add_subpops.Rd
Generate a code block that just adds subpopulations to a SLiM simulation
slim_block_add_subpops(
n_pop = 1,
sizes,
generation = 1,
when = c("early", "late")
)
Number of subpopulations to add
Population sizes of subpopulations. Should have a length equal to n_pop
, or
else a length of 1 (in which case it will be recycled to n_pop
)
The generation to add the subpopulations (default: 1)
When to add the subpopulations ("early" or "late"). Default: "early"
A slimr_block
object
slim_block_add_subpops(2, 100)
#> A slimr_block:
#> <slimr_script[1]>
#> block_1:1 early() {
#> {
#> sim.addSubpop(p1, 100);
#> sim.addSubpop(p2, 100);
#> }
#> }