This function loads R objects to stand in for standard Globals used in SLiM.
These will be available in the global environment and can be used to aid in
autocompletion and help retrieval, saving typing of this pattern: p1%.%Subpopulation$setSubpopulationSize(N)
--
instead one can just type: p1$setSubpopulationSize(N)
: this will be replaced by correct SLiM code:
p1.setSubpopulationSize(N)
By default this will load ten of each of the standard SLiM Globals (e.g. objects prefixed with "p",
"m", "i", "g", and "s"), as well as the "sim" and "self" singular Globals. Note: be careful with
this function. If you have any objects in your R session's global environment with these names
they will be overwritten.
slim_load_globals(
max = 10,
sim = TRUE,
community = TRUE,
self = TRUE,
pseudo = TRUE
)
A single integer values indicating how many of each numbered Globals to load, or a named integer vector where the names refer to different Global types (see details for more information), and the value refers to how many of that Global type to load.
Should the sim
global be loaded?
Should the community
global be loaded?
Should the self
global be loaded?
Should 'pseudo-variables' be loaded? These are similar to SLiM globals but are only available inside certain callbacks.
None
slim_load_globals(c(p = 4, g = 2))
#> Warning: slim_load_globals modifies the global environment so please be careful when using this function!
#> It has assigned values to the following names:
#>
#> • p1, p2, p3, p4
#> • g1, g2
#> • sim
#> • community
#> • self
#> • genome1
#> • genome2
#> • childGenome1
#> • childGenome2
#> • parent1Genome1
#> • parent1Genome2
#> • parent2Genome1
#> • parent2Genome2
#> • subpop
#> • sourceSubpop
#> • individual
#> • receiver
#> • exerter
#> • child
#> • parent1
#> • parent2
#> • mut
#>
#> If there were already objects with any of these names in the global environment
#> then their values have been replaced.
#> Use slim_unload_globals() to remove them.
#> This warning is displayed once per session.