Learn R Programming

NetLogoR (version 1.0.5)

bbox: Extract or set bounding box

Description

These are methods for classes in NetLogoR, i.e., agentMatrix, worldMatrix, and worldArray.

Replacement method sets the bbox attribute of an agentMatrix.

Usage

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)

Value

The replacement method returns the same object as supplied to obj, i.e., an agentMatrix, with the bbox attribute set to value.

Arguments

obj

object deriving from class "agentMatrix", or for bbox and extent, a "worldMatrix" or "worldArray"

value

2x2 matrix representing the bounding box. See sp::bbox.

See Also

extent(), coordinates(), sp::bbox

Examples

Run this code
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)
extent(newAgent)
coordinates(newAgent)

Run the code above in your browser using DataLab