Description Usage Arguments Value Author(s) Examples
View source: R/raster2magpie.R
Raster data (layers, bricks or stacks) from the raster package is converted to a MAgPIE object. In the case of bricks and stacks different data dimensions are created for the different layers. Data should be in lat/long with a 0.5x0.5 degree resolution, and have at least the extent of MAgPIE data (-180,180,-56,83.5)
1 | raster2magpie(x, detect_years=TRUE)
|
x |
A raster object |
detect_years |
The function can try to detect years (4 digit numbers) in the names of the raster, and use them as the temporal dimension |
A MAgPIE object with the data of the raster at the geographic center of each MAgIE cell
Ulrich Kreidenweis
1 2 3 4 5 6 7 8 | ## Not run:
r <- raster::raster()
raster::res(r) <- 0.5
raster::values(r) <- 1:(raster::ncell(r))
m <- raster2magpie(r)
head(m)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.