Learn R Programming

NetLogoR (version 0.3.9)

PxcorPycorFromCell: Patches coordinates from cells numbers

Description

Report the patches coordinates pxcor and pycor given the cells numbers as defined for a Raster* object.

Usage

PxcorPycorFromCell(world, cellNum)

# S4 method for worldNLR,numeric PxcorPycorFromCell(world, cellNum)

Arguments

world

WorldMatrix or worldArray object.

cellNum

Integer. Vector of cells number.

Value

Matrix (ncol = 2) with the first column pxcor and the second column pycor in the order of the given cellNum.

Examples

Run this code
# NOT RUN {
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
cellNum <- cellFromPxcorPycor(world = w1, pxcor = 0, pycor = 9)
PxcorPycorFromCell(world = w1, cellNum = cellNum)
cellNum <- cellFromPxcorPycor(world = w1, pxcor = c(0, 1, 2), pycor = 0)
PxcorPycorFromCell(world = w1, cellNum = cellNum)

# }

Run the code above in your browser using DataLab