downsize {SIMplyBee} | R Documentation |
Reduce number of workers and remove all drones and virgin queens from a Colony or MultiColony object
Description
Level 2 function that downsizes a Colony or MultiColony object by removing a proportion of workers, all drones and all virgin queens. Usually in the autumn, such an event occurs in preparation for the winter months.
Usage
downsize(x, p = NULL, use = "rand", new = FALSE, simParamBee = NULL, ...)
Arguments
x |
|
p |
numeric, proportion of workers to be removed from the colony; if
|
use |
character, all the options provided by |
new |
logical, should we remove all current workers and add a targeted proportion anew (say, create winter workers) |
simParamBee |
|
... |
additional arguments passed to |
Value
Colony-class
or MultiColony-class
with workers reduced and
drones/virgin queens removed
Examples
founderGenomes <- quickHaplo(nInd = 4, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(x = basePop[1], nInd = 100)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 3, nDrones = 12)
# Create and cross Colony and MultiColony class
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = droneGroups[[1]])
colony <- buildUp(colony)
apiary <- createMultiColony(basePop[3:4], n = 2)
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])
apiary <- buildUp(apiary)
# Downsize
colony <- downsize(x = colony, new = TRUE, use = "rand")
colony
apiary <- downsize(x = apiary, new = TRUE, use = "rand")
apiary[[1]]
# Downsize with different numbers
nWorkers(apiary); nDrones(apiary)
apiary <- downsize(x = apiary, p = c(0.5, 0.1), new = TRUE, use = "rand")
nWorkers(apiary); nDrones(apiary)