View source: R/as.RasterBrick.R
as.RasterBrick | R Documentation |
Convert magclass object to a RasterBrick object
as.RasterBrick(x, res = NULL)
x |
MAgPIE object |
res |
spatial data resolution. If not provided it will be guessed. |
A RasterBrick object
Jan Philipp Dietrich
getCoords
## Not run:
if (requireNamespace("raster", quietly = TRUE)) {
r <- raster::brick(ncols = 36, nrows = 18, nl = 4)
r[14:18, 25:28] <- (1:20 %*% t(1:4))
names(r) <- c("y2000..bla", "y2001..bla", "y2000..blub", "y2001..blub")
m <- as.magpie(r)
r2 <- as.RasterBrick(m)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.