Level 0 function that returns the queen's age.
getQueenAge(x, currentYear)
Pop-class
, Colony-class
, or
MultiColony-class
integer, current year
numeric, the age of the queen(s); named when theres is more
than one queen; NA
if queen not present
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 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 createMultiColony(basePop[3:4], n = 2): object 'basePop' 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 is(x, class2 = "Colony"): object 'colony' not found
queen <- setQueensYearOfBirth(queen, year = 2020)
#> Error in is(x, class2 = "Pop"): object 'queen' not found
getQueenAge(queen, currentYear = 2022)
#> Error in is(x, class2 = "Pop"): object 'queen' not found
colony <- setQueensYearOfBirth(colony, year = 2021)
#> Error in is(x, class2 = "Pop"): object 'colony' not found
getQueenAge(colony, currentYear = 2022)
#> Error in is(x, class2 = "Pop"): object 'colony' not found
apiary <- setQueensYearOfBirth(apiary, year = 2018)
#> Error in is(x, class2 = "Pop"): object 'apiary' not found
getQueenAge(apiary, currentYear = 2022)
#> Error in is(x, class2 = "Pop"): object 'apiary' not found