Learn R Programming

SIMplyBee (version 0.4.1)

setQueensYearOfBirth: Set the queen's year of birth

Description

Level 1 function that sets the queen's year of birth.

Usage

setQueensYearOfBirth(x, year, simParamBee = NULL)

Value

Pop-class, Colony-class, or

MultiColony-class with queens having the year of birth set

Arguments

x

Pop-class (one or more than one queen), Colony-class (one colony), or MultiColony-class (more colonies)

year

integer, the year of the birth of the queen

simParamBee

SimParamBee, global simulation parameters

Examples

Run this code
founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
basePop <- createVirginQueens(founderGenomes)

drones <- createDrones(x = basePop[1], nInd = 1000)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = nFathersPoisson)

# Create a Colony and a MultiColony class
colony <- createColony(x = basePop[2])
colony <- cross(x = colony, drones = droneGroups[[1]])
apiary <- createMultiColony(basePop[3:4], n = 2)
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])

# Example on Colony class
getQueenYearOfBirth(colony)
getQueenYearOfBirth(apiary)

queen1 <- getQueen(colony)
queen1 <- setQueensYearOfBirth(queen1, year = 2022)
getQueenYearOfBirth(queen1)

colony <- setQueensYearOfBirth(colony, year = 2022)
getQueenYearOfBirth(colony)

apiary <- setQueensYearOfBirth(apiary, year = 2022)
getQueenYearOfBirth(apiary)

Run the code above in your browser using DataLab