Check whether a population, colony or a multicolony object has no individuals within.

isEmpty(x)

Arguments

x

Pop-class or Colony-class or MultiColony-class

Value

boolean when x is Pop-class or

Colony-class, and named vector of boolean when

x is MultiColony-class

Examples

founderGenomes <- quickHaplo(nInd = 5, 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

isEmpty(new(Class = "Pop"))
#> [1] TRUE
isEmpty(basePop[0])
#> Error in eval(expr, envir, enclos): object 'basePop' not found
isEmpty(basePop)
#> Error in eval(expr, envir, enclos): object 'basePop' not found

emptyColony <- createColony()
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
nonEmptyColony <- createColony(basePop[1])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
isEmpty(emptyColony)
#> Error in eval(expr, envir, enclos): object 'emptyColony' not found
isEmpty(nonEmptyColony)
#> Error in eval(expr, envir, enclos): object 'nonEmptyColony' not found

emptyApiary <- createMultiColony(n = 3)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
emptyApiary1 <- c(createColony(), createColony())
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
emptyApiary2 <- createMultiColony()
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
nonEmptyApiary <- createMultiColony(basePop[2:5], n = 4)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found

isEmpty(emptyApiary)
#> Error in eval(expr, envir, enclos): object 'emptyApiary' not found
isEmpty(emptyApiary1)
#> Error in eval(expr, envir, enclos): object 'emptyApiary1' not found
isEmpty(nonEmptyApiary)
#> Error in eval(expr, envir, enclos): object 'nonEmptyApiary' not found
isNULLColonies(emptyApiary)
#> Error in eval(expr, envir, enclos): object 'emptyApiary' not found
isNULLColonies(emptyApiary1)
#> Error in eval(expr, envir, enclos): object 'emptyApiary1' not found
isNULLColonies(nonEmptyApiary)
#> Error in eval(expr, envir, enclos): object 'nonEmptyApiary' not found

nEmptyColonies(emptyApiary)
#> Error in eval(expr, envir, enclos): object 'emptyApiary' not found
nEmptyColonies(emptyApiary1)
#> Error in eval(expr, envir, enclos): object 'emptyApiary1' not found
nEmptyColonies(nonEmptyApiary)
#> Error in eval(expr, envir, enclos): object 'nonEmptyApiary' not found
nNULLColonies(emptyApiary)
#> Error in eval(expr, envir, enclos): object 'emptyApiary' not found
nNULLColonies(emptyApiary1)
#> Error in eval(expr, envir, enclos): object 'emptyApiary1' not found
nNULLColonies(nonEmptyApiary)
#> Error in eval(expr, envir, enclos): object 'nonEmptyApiary' not found