NLworldIndex | R Documentation |
WorldMatrix
indices from vector indicesConvert vector indices or Raster*
cell numbers into worldMatrix
indices.
NLworldIndex(world, cellNum) ## S4 method for signature 'worldMatrix,numeric' NLworldIndex(world, cellNum)
world |
|
cellNum |
Integer. Vector of cells number. |
Numeric. Vector of worldMatrix
indices.
Eliot McIntire
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9, data = 1:100) w1Ras <- world2raster(w1) index <- 24 pxpy <- PxcorPycorFromCell(world = w1, cellNum = index) rasValue <- as.integer(unname(w1Ras[index])) # Not correct index: identical(w1[index], rasValue) # Correct index identical(w1[NLworldIndex(w1, index)], rasValue)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.