Level 0 function that returns the queen's year of birth.

getQueenYearOfBirth(x, simParamBee = NULL)

Arguments

x

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

simParamBee

SimParamBee, global simulation parameters

Value

numeric, the year of birth of the queen(s); named when theres is more than one queen; NA if queen not present

Examples

founderGenomes <- quickHaplo(nInd = 8, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
SP$nThreads = 1L
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 and a MultiColony 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

apiary <- createMultiColony(basePop[3:4], n = 2)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- cross(apiary, drones = droneGroups[c(2, 3)])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

queen <- getQueen(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
queen <- setQueensYearOfBirth(queen, year = 2022)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenYearOfBirth(queen)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

getQueenYearOfBirth(getQueen(colony))
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- setQueensYearOfBirth(colony, year = 2030)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenYearOfBirth(colony)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

apiary <- setQueensYearOfBirth(apiary, year = 2022)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getQueenYearOfBirth(apiary)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found