removeCastePop {SIMplyBee} | R Documentation |
Remove a proportion of caste individuals from a colony
Description
Level 2 function that removes a proportion of virgin queens of a Colony or MultiColony object
Usage
removeCastePop(
x,
caste = NULL,
p = 1,
use = "rand",
addVirginQueens = FALSE,
nVirginQueens = NULL,
year = NULL,
simParamBee = NULL
)
removeQueen(
x,
addVirginQueens = FALSE,
nVirginQueens = NULL,
year = NULL,
simParamBee = NULL
)
removeWorkers(x, p = 1, use = "rand")
removeDrones(x, p = 1, use = "rand")
removeVirginQueens(x, p = 1, use = "rand")
Arguments
x |
|
caste |
character, "queen", "workers", "drones", or "virginQueens" |
p |
numeric, proportion to be removed; if input is |
use |
character, all the options provided by |
addVirginQueens |
logical, whether virgin queens should be added; only used when removing the queen from the colony |
nVirginQueens |
integer, the number of virgin queens to be created in the
colony; only used when removing the queen from the colony. If |
year |
numeric, only relevant when adding virgin queens - year of birth for virgin queens |
simParamBee |
|
Value
Colony-class
or MultiColony-class
without virgin queens
Functions
-
removeQueen()
: Remove queen from a colony -
removeWorkers()
: Remove workers from a colony -
removeDrones()
: Remove workers from a colony -
removeVirginQueens()
: Remove virgin queens from a colony
Examples
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(x = basePop[1], nInd = 100)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 5, nDrones = nFathersPoisson)
# Create and cross Colony and MultiColony class
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = droneGroups[[1]])
colony <- buildUp(colony)
apiary <- createMultiColony(basePop[4:5], n = 2)
apiary <- cross(apiary, drones = droneGroups[3:4])
apiary <- buildUp(apiary)
# Remove workers
nWorkers(colony)
colony <- removeCastePop(colony, caste = "workers", p = 0.3)
# or alias:
colony <- removeWorkers(colony, p = 0.3)
# Same aliases exist for all the castes!!
nWorkers(apiary)
apiary <- removeCastePop(apiary, caste = "workers", p = 0.3)
nWorkers(apiary)
# Remove different proportions
apiary <- buildUp(apiary)
nWorkers(apiary)
nWorkers(removeWorkers(apiary, p = c(0.1, 0.5)))