MultiColony-class {SIMplyBee} | R Documentation |
Honeybee multicolony object
Description
An object holding a collection of honeybee colonies. It behaves like a list.
Usage
isMultiColony(x)
## S4 method for signature 'MultiColony'
show(object)
## S4 method for signature 'MultiColony'
c(x, ...)
## S4 method for signature 'MultiColonyOrNULL'
c(x, ...)
## S4 method for signature 'MultiColony,integerOrNumericOrLogical'
x[i, j, drop]
## S4 method for signature 'MultiColony,character'
x[i, j, drop]
## S4 method for signature 'MultiColony,integerOrNumericOrLogical'
x[[i]]
## S4 method for signature 'MultiColony,character'
x[[i]]
## S4 replacement method for signature
## 'MultiColony,integerOrNumericOrLogicalOrCharacter,ANY,MultiColony'
x[i, j] <- value
## S4 replacement method for signature
## 'MultiColony,integerOrNumericOrLogicalOrCharacter,ANY,Colony'
x[[i, j]] <- value
Arguments
x |
|
object |
|
... |
|
i |
integer, numeric, logical, or character, index or ID to select a colony (see examples) |
j |
not used |
drop |
not used |
value |
|
Value
MultiColony-class
or Colony-class
Functions
-
isMultiColony()
: Test if x is a MultiColony class object -
show(MultiColony)
: Show MultiColony object -
c(MultiColony)
: Combine multiple Colony and MultiColony objects -
c(MultiColonyOrNULL)
: Combine multiple Colony and MultiColony objects -
x[i
: Extract a colony (one or more!) with an integer/numeric/logical index (position) (returnMultiColony-class
) -
x[i
: Extract a colony (one or more!) with a character ID (name) (returnMultiColony-class
) -
x[[i
: Extract a colony (just one!) with an integer/numeric/logical index (position) (returnColony-class
) -
x[[i
: Extract a colony (just one!) with a character ID (name) (returnColony-class
) -
`[`(x = MultiColony, i = integerOrNumericOrLogicalOrCharacter, j = ANY) <- value
: Assign colonies into MultiColony -
`[[`(x = MultiColony, i = integerOrNumericOrLogicalOrCharacter, j = ANY) <- value
: Assign Colony into MultiColony
Slots
colonies
list, a collection of
Colony-class
objects
See Also
Examples
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 100)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(x = basePop[1], nInd = 1000)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = nFathersPoisson)
apiary <- createMultiColony(basePop[1:6], n = 6)
apiary <- cross(apiary, drones = droneGroups[1:6])
apiary
show(apiary)
is(apiary)
isMultiColony(apiary)
getId(apiary)
apiary[1]
getId(apiary[1])
getId(apiary["2"])
getId(apiary[2])
getId(apiary[-1])
getId(apiary[5])
getId(apiary)
getId(apiary[c(1, 3)])
getId(apiary[c("2", "4")])
getId(apiary[c(TRUE, FALSE, TRUE, FALSE)])
getId(apiary[c(TRUE, FALSE)]) # beware of recycling!
getId(apiary[c(5, 6)])
getId(apiary[c("6", "7")])
apiary[[1]]
apiary[["2"]]
apiary[[3]]
apiary[["4"]]
try(apiary[[6]])
apiary[["7"]]
getId(c(apiary[c(1, 3)], apiary[2]))
getId(c(apiary[2], apiary[c(1, 3)]))
getId(c(apiary[2], apiary[0]))
getId(c(apiary[0], apiary[2]))
getId(c(apiary[2], NULL))
getId(c(NULL, apiary[2]))
apiary1 <- apiary[1:2]
apiary2 <- apiary[3:4]
getId(apiary1)
getId(apiary2)
apiary1[[1]] <- apiary2[[1]]
getId(apiary1)
try(apiary2[[1]] <- apiary2[[2]])
apiary1 <- apiary[1:2]
apiary2 <- apiary[3:5]
getId(apiary1)
getId(apiary2)
apiary2[1:2] <- apiary1
getId(apiary2)
try(apiary2[1] <- apiary1)
try(apiary2[1:3] <- apiary1)
try(apiary2[1:2] <- apiary1[[1]])
apiary2 <- apiary[3:5]
getId(apiary2)
try(apiary2[c("4", "5")] <- apiary1)
try(apiary2[c("4", "5")] <- apiary1)