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

Colony-class or MultiColony-class

caste

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

p

numeric, proportion to be removed; 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 virgins queens that will stay when p < 1

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 0, no virgin queens are added; If NULL, the value from simParamBee$nVirginQueens is used

year

numeric, only relevant when adding virgin queens - year of birth for virgin queens

simParamBee

SimParamBee, global simulation parameters

Value

Colony-class or MultiColony-class without 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]])
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)))

[Package SIMplyBee version 0.3.0 Index]