replaceCastePop {SIMplyBee} | R Documentation |
Replace a proportion of caste individuals with new ones
Description
Level 2 function that replaces a proportion of caste individuals with new individuals from a Colony or MultiColony object. Useful after events like season change, swarming, supersedure, etc. due to the short life span honeybees.
Usage
replaceCastePop(
x,
caste = NULL,
p = 1,
use = "rand",
exact = TRUE,
year = NULL,
simParamBee = NULL
)
replaceWorkers(x, p = 1, use = "rand", exact = TRUE, simParamBee = NULL)
replaceDrones(x, p = 1, use = "rand", simParamBee = NULL)
replaceVirginQueens(x, p = 1, use = "rand", simParamBee = NULL)
Arguments
x |
|
caste |
character, "workers", "drones", or "virginQueens" |
p |
numeric, proportion of caste individuals to be replaced with new ones;
if input is |
use |
character, all the options provided by |
exact |
logical, only relevant when adding workers - if the csd locus is turned
on and exact is |
year |
numeric, only relevant when replacing virgin queens, year of birth for virgin queens |
simParamBee |
|
Value
Colony-class
or or MultiColony-class
with
replaced virgin queens
Functions
-
replaceWorkers()
: Replaces some workers in a colony -
replaceDrones()
: Replaces some drones in a colony -
replaceVirginQueens()
: Replaces some virgin queens in 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]])
apiary <- createMultiColony(basePop[4:5], n = 2)
apiary <- cross(apiary, drones = droneGroups[3:4])
# Add individuals
colony <- buildUp(colony, nWorkers = 5, nDrones = 2)
apiary <- buildUp(apiary, nWorkers = 5, nDrones = 2)
# Replace workers in a colony
getCasteId(colony, caste = "workers")
colony <- replaceCastePop(colony, caste = "workers", p = 0.5)
# You can also use an alias
replaceWorkers(colony, p = 0.5)
# Same aliases exist for all the castes!!!
getCasteId(colony, caste = "workers")
getCasteId(apiary, caste="workers")
apiary <- replaceWorkers(apiary, p = 0.5)
getCasteId(apiary, caste="workers")