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)
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 isEmpty(basePop[0]): object 'basePop' not found
isEmpty(basePop)
#> Error in isEmpty(basePop): 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 isEmpty(emptyColony): object 'emptyColony' not found
isEmpty(nonEmptyColony)
#> Error in isEmpty(nonEmptyColony): object 'nonEmptyColony' not found

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

isEmpty(emptyApiary)
#> <NA> <NA> <NA> 
#> TRUE TRUE TRUE 
isEmpty(emptyApiary1)
#> Error in isEmpty(emptyApiary1): object 'emptyApiary1' not found
isEmpty(nonEmptyApiary)
#> Error in isEmpty(nonEmptyApiary): object 'nonEmptyApiary' not found
isNULLColonies(emptyApiary)
#> <NA> <NA> <NA> 
#> TRUE TRUE TRUE 
isNULLColonies(emptyApiary1)
#> Error in is(x, class2 = "MultiColony"): object 'emptyApiary1' not found
isNULLColonies(nonEmptyApiary)
#> Error in is(x, class2 = "MultiColony"): object 'nonEmptyApiary' not found

nEmptyColonies(emptyApiary)
#> [1] 3
nEmptyColonies(emptyApiary1)
#> Error in "MultiColony" %in% class(multicolony): object 'emptyApiary1' not found
nEmptyColonies(nonEmptyApiary)
#> Error in "MultiColony" %in% class(multicolony): object 'nonEmptyApiary' not found
nNULLColonies(emptyApiary)
#> [1] 3
nNULLColonies(emptyApiary1)
#> Error in "MultiColony" %in% class(multicolony): object 'emptyApiary1' not found
nNULLColonies(nonEmptyApiary)
#> Error in "MultiColony" %in% class(multicolony): object 'nonEmptyApiary' not found