These are methods for classes in NetLogoR, i.e., agentMatrix, worldMatrix,
and worldArray.
Replacement method sets the bbox attribute of an agentMatrix.
bbox(obj)
# S4 method for agentMatrix
bbox(obj)
# S4 method for ANY
bbox(obj)
bbox(obj) <- value
# S4 method for agentMatrix,matrix
bbox(obj) <- value
# S4 method for worldNLR
bbox(obj)
# S4 method for SpatExtent
bbox(obj)object deriving from class "agentMatrix",
or for bbox and extent, a "worldMatrix" or "worldArray"
2x2 matrix representing the bounding box. See sp::bbox.
The replacement method returns the same object as supplied to
obj, i.e., an agentMatrix, with the bbox attribute set to value.
extent(), coordinates(), sp::bbox
newAgent <- agentMatrix(
  coords = cbind(pxcor = c(1, 2, 5), pycor = c(3, 4, 6)),
  char = letters[c(1, 2, 6)],
  nums2 = c(4.5, 2.6, 2343),
  char2 = LETTERS[c(4, 24, 3)],
  nums = 5:7
)
bbox(newAgent)
#>      min max
#> xcor   1   5
#> ycor   3   6
extent(newAgent)
#> SpatExtent : 1, 5, 3, 6 (xmin, xmax, ymin, ymax)
coordinates(newAgent)
#>      xcor ycor
#> [1,]    1    3
#> [2,]    2    4
#> [3,]    5    6