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

setQueensYearOfBirth(x, year)

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

Value

Pop-class, Colony-class, or

MultiColony-class with queens having the year of birth set

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 and a MultiColony class
colony <- createColony(x = basePop[2])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- cross(x = 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

# Example on Colony class
getQueenYearOfBirth(colony)
#> Error in is(x, class2 = "Pop"): object 'colony' not found
getQueenYearOfBirth(apiary)
#> Error in is(x, class2 = "Pop"): object 'apiary' not found

queen1 <- getQueen(colony)
#> Error in is(x, class2 = "Colony"): object 'colony' not found
queen1 <- setQueensYearOfBirth(queen1, year = 2022)
#> Error in is(x, class2 = "Pop"): object 'queen1' not found
getQueenYearOfBirth(queen1)
#> Error in is(x, class2 = "Pop"): object 'queen1' not found

colony <- setQueensYearOfBirth(colony, year = 2022)
#> Error in is(x, class2 = "Pop"): object 'colony' not found
getQueenYearOfBirth(colony)
#> Error in is(x, class2 = "Pop"): object 'colony' not found

apiary <- setQueensYearOfBirth(apiary, year = 2022)
#> Error in is(x, class2 = "Pop"): object 'apiary' not found
getQueenYearOfBirth(apiary)
#> Error in is(x, class2 = "Pop"): object 'apiary' not found