Documentation for SLiM function addSubpop, which is a method of the SLiM class Species. Note that the R function is a stub, it does not do anything in R (except bring up this documentation). It will only do anything useful when used inside a slim_block function further nested in a slim_script function call, where it will be translated into valid SLiM code as part of a full SLiM script.

addSubpop(subpopID, size, sexRatio, haploid)

Arguments

subpopID

An object of type integer or string. Must be of length 1 (a singleton). See details for description.

size

An object of type integer. Must be of length 1 (a singleton). See details for description.

sexRatio

An object of type float. Must be of length 1 (a singleton). The default value is 0.5. See details for description.

haploid

An object of type logical. Must be of length 1 (a singleton). The default value is F. See details for description.

Value

An object of type Subpopulation object. Return will be of length 1 (a singleton)

Details

Documentation for this function can be found in the official SLiM manual: page 719.

Add a new subpopulation with id subpopID and size individuals. The subpopID parameter may be either an integer giving the ID of the new subpopulation, or a string giving the name of the new subpopulation (such as "p5" to specify an ID of 5). Only if sex is enabled for the species, the initial sex ratio may optionally be specified as sexRatio (as the male fraction, M:M+F); if it is not specified, a default of 0.5 is used. The new subpopulation will be defined as a global variable immediately by this method (see section 25.16), and will also be returned by this method. Subpopulations added by this method will initially consist of individuals with empty genomes. In order to model subpopulations that split from an already existing subpopulation, use addSubpopSplit(). Only in nonWF models, the haploid parameter may be T; in this case, the second genome of each new individual will be a null genome, rather than an empty genome. For even greater control in nonWF models, you can call addSubpop() with an initial size of 0 and then stock the population with new individuals created however you wish in the next tick's reproduction() callback.

Author

Benjamin C Haller (bhaller@benhaller.com) and Philipp W Messer (messer@cornell.edu)