| world2spatRast | R Documentation |
worldMatrix or worldArray object into a SpatRaster objectConvert a worldMatrix object or a
worldArray object into a SpatRaster object
world2spatRast(world)
## S4 method for signature 'worldMatrix'
world2spatRast(world)
## S4 method for signature 'worldArray'
world2spatRast(world)
world |
|
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.
SpatRaster object.
Patches value are retained from the world.
Sarah Bauduin
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.