| world2raster | R Documentation |
worldMatrix or worldArray object into a Raster* objectConvert a worldMatrix object into a RasterLayer object or a
worldArray object into a RasterStack object
world2raster(world)
## S4 method for signature 'worldMatrix'
world2raster(world)
## S4 method for signature 'worldArray'
world2raster(world)
world |
|
The Raster* 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.
RasterLayer or RasterStack object depending on the input world.
Patches value are retained from the world.
Sarah Bauduin
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9, data = runif(100))
if (requireNamespace("raster", quietly = TRUE)) {
r1 <- world2raster(w1)
terra::plot(r1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.