setLocation {SIMplyBee} | R Documentation |
Set colony location
Description
Level 2 function that to set a Colony or MultiColony object location to (x, y) coordinates.
Usage
setLocation(x, location = c(0, 0))
Arguments
x |
|
location |
numeric, list, or data.frame, x and y coordinates of colony
locations as
|
Value
Colony-class
or MultiColony-class
with set
location
Examples
founderGenomes <- quickHaplo(nInd = 5, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
drones <- createDrones(basePop[1], n = 1000)
droneGroups <- pullDroneGroupsFromDCA(drones, n = 4, nDrones = 10)
# Create Colony and MultiColony class
colony <- createColony(x = basePop[2])
colony <- cross(colony, drones = droneGroups[[1]])
apiary <- createMultiColony(basePop[3:5])
apiary <- cross(apiary, drones = droneGroups[2:4])
getLocation(colony)
getLocation(apiary)
loc <- c(1, 1)
colony <- setLocation(colony, location = loc)
getLocation(colony)
# Assuming one location (as in bringing colonies to one place!)
apiary <- setLocation(apiary, location = loc)
getLocation(apiary)
# Assuming different locations
locList <- list(c(0, 0), c(1, 1), c(2, 2))
apiary <- setLocation(apiary, location = locList)
getLocation(apiary)
locDF <- data.frame(x = c(0, 1, 2), y = c(0, 1, 2))
apiary <- setLocation(apiary, location = locDF)
getLocation(apiary)
[Package SIMplyBee version 0.4.1 Index]