Level 0 function that tests if individuals are members of a specific caste

isCaste(x, caste, simParamBee = NULL)

isQueen(x, simParamBee = NULL)

isFather(x, simParamBee = NULL)

isWorker(x, simParamBee = NULL)

isDrone(x, simParamBee = NULL)

isVirginQueen(x, simParamBee = NULL)

Arguments

x

Pop-class

caste

character, one of "queen", "fathers", "workers", "drones", or "virginQueens"; only single value is used

simParamBee

SimParamBee, global simulation parameters

Value

logical

Functions

  • isQueen(): Is individual a queen

  • isFather(): Is individual a father

  • isWorker(): Is individual a worker

  • isDrone(): Is individual a drone

  • isVirginQueen(): Is individual a virgin queen

See also

isQueen, isFather, isVirginQueen, isWorker, and isDrone

Examples

founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

drones <- createDrones(x = basePop[1], nInd = 1000)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = nFathersPoisson)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

# Create a Colony class
colony <- createColony(x = basePop[2])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- cross(colony, drones = droneGroups[[1]])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- buildUp(x = colony, nWorkers = 120, nDrones = 20)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- addVirginQueens(x = colony, nInd = 4)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isCaste(getQueen(colony), caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(getFathers(colony, nInd = 2), caste = "fathers")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(getWorkers(colony, nInd = 2), caste = "workers") # random sample!
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(getDrones(colony, nInd = 2), caste = "drones")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(getVirginQueens(colony, nInd = 2), caste = "virginQueens")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

bees <- c(
  getQueen(colony),
  getFathers(colony, nInd = 2),
  getWorkers(colony, nInd = 2),
  getDrones(colony, nInd = 2),
  getVirginQueens(colony, nInd = 2)
)
#> Error in is(x, class2 = "Colony"): object 'colony' not found
isCaste(bees, caste = "queen")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(bees, caste = "fathers")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(bees, caste = "workers")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(bees, caste = "drones")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isCaste(bees, caste = "virginQueens")
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isQueen(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isQueen(getFathers(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isFather(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isFather(getFathers(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isWorker(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isWorker(getFathers(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isWorker(getWorkers(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isDrone(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isDrone(getFathers(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isDrone(getDrones(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isVirginQueen(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isVirginQueen(getFathers(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isVirginQueen(getVirginQueens(colony, nInd = 2))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found