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

Colony-class or MultiColony-class

caste

character, "workers", "drones", or "virginQueens"

p

numeric, proportion of caste individuals to be replaced with new ones; 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 - guides selection of caste individuals that stay when p < 1

exact

logical, only relevant when adding workers - if the csd locus is turned on and exact is TRUE, we replace the exact specified number of viable workers (heterozygous at the csd locus). You probably want this set to TRUE since you want to replace with the same number of workers.

year

numeric, only relevant when replacing virgin queens, year of birth for virgin queens

simParamBee

SimParamBee, global simulation parameters

Value

Colony-class or or MultiColony-class with replaced virgin queens

Functions

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")

[Package SIMplyBee version 0.3.0 Index]