world2spatRast {NetLogoR} | R Documentation |
Convert a worldMatrix
or worldArray
object into a SpatRaster
object
Description
Convert a worldMatrix
object or a
worldArray
object into a SpatRaster
object
Usage
world2spatRast(world)
## S4 method for signature 'worldMatrix'
world2spatRast(world)
## S4 method for signature 'worldArray'
world2spatRast(world)
Arguments
world |
|
Details
The SpatRaster
returned has the same extent and resolution as the world
with round coordinates at the center of the cells and coordinates x.5
at the edges of the cells.
Value
SpatRaster
object.
Patches
value are retained from the world
.
Author(s)
Sarah Bauduin
Examples
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9, data = runif(100))
r1 <- world2spatRast(w1)
terra::plot(r1)
w2 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9, data = 0)
w3 <- stackWorlds(w1, w2)
r3 <- world2spatRast(w3)
terra::plot(r3)
[Package NetLogoR version 1.0.5 Index]