Level 2 function that to set a Colony or MultiColony object location to (x, y) coordinates.
setLocation(x, location)
numeric or list, location to be set for the
Colony-class
or for MultiColony-class
; when
numeric the same location will be set for all colonies; when list different
locations will be set for each colony - the list has to have the same
length at there are colonies in x
)
Colony-class
or MultiColony-class
with set
location
founderGenomes <- quickHaplo(nInd = 10, nChr = 1, segSites = 50)
SP <- SimParamBee$new(founderGenomes)
basePop <- createVirginQueens(founderGenomes)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
drones <- createDrones(basePop[1], n = 1000)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
droneGroups <- pullDroneGroupsFromDCA(drones, n = 10, nDrones = 10)
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
# Create Colony and MultiColony class
colony <- createColony(x = basePop[2])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
colony <- cross(colony, drones = droneGroups[[1]])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
apiary <- createMultiColony(basePop[3:8], n = 6)
#> Error in createMultiColony(basePop[3:8], n = 6): object 'basePop' not found
apiary <- cross(apiary, drones = droneGroups[2:7])
#> Error in get(x = "SP", envir = .GlobalEnv): object 'SP' not found
getLocation(colony)
#> Error in is(x, class2 = "Colony"): object 'colony' not found
getLocation(apiary)
#> Error in is(x, class2 = "Colony"): object 'apiary' not found
loc1 <- c(512, 722)
colony <- setLocation(colony, location = loc1)
#> Error in is(x, class2 = "Colony"): object 'colony' not found
getLocation(colony)
#> Error in is(x, class2 = "Colony"): object 'colony' not found
# Assuming one location (as in bringing colonies to one place!)
apiary <- setLocation(apiary, location = loc1)
#> Error in is(x, class2 = "Colony"): object 'apiary' not found
getLocation(apiary)
#> Error in is(x, class2 = "Colony"): object 'apiary' not found