as.RasterBrick: as.RasterBrick

View source: R/as.RasterBrick.R

as.RasterBrickR Documentation

as.RasterBrick

Description

Convert magclass object to a RasterBrick object

Usage

as.RasterBrick(x, res = NULL)

Arguments

x

MAgPIE object

res

spatial data resolution. If not provided it will be guessed.

Value

A RasterBrick object

Author(s)

Jan Philipp Dietrich

See Also

getCoords

Examples

## 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)

magclass documentation built on May 29, 2024, 6:20 a.m.