bbox {NetLogoR}R Documentation

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 signature 'agentMatrix'
bbox(obj)

## S4 method for signature 'ANY'
bbox(obj)

bbox(obj) <- value

## S4 replacement method for signature 'agentMatrix,matrix'
bbox(obj) <- value

## S4 method for signature 'worldNLR'
bbox(obj)

## S4 method for signature 'SpatExtent'
bbox(obj)

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.

Value

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

See Also

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

Examples

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)

[Package NetLogoR version 1.0.5 Index]