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

Colony-class or MultiColony-class

p

numeric, proportion of workers to be removed from the colony; if NULL then SimParamBee$downsizeP is used. If input is MultiColony-class, the input could also be a vector of the same length as the number of colonies. If a single value is provided, the same value will be applied to all the colonies

use

character, all the options provided by selectInd; it guides the selection of workers that will be removed

new

logical, should we remove all current workers and add a targeted proportion anew (say, create winter workers)

simParamBee

SimParamBee, global simulation parameters

...

additional arguments passed to p when this argument is a function

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)

[Package SIMplyBee version 0.3.0 Index]