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

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.

Author

Sarah Bauduin

Examples

w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
cellNum <- cellFromPxcorPycor(world = w1, pxcor = 0, pycor = 9)
PxcorPycorFromCell(world = w1, cellNum = cellNum)
#>      pxcor pycor
#> [1,]     0     9
cellNum <- cellFromPxcorPycor(world = w1, pxcor = c(0, 1, 2), pycor = 0)
PxcorPycorFromCell(world = w1, cellNum = cellNum)
#>      pxcor pycor
#> [1,]     0     0
#> [2,]     1     0
#> [3,]     2     0