extend | R Documentation |
Extend a magpie object to a dense grid based on the given xRange, yRange and resolution. This is e.g. required when writing netCDF files. Extending a sparse magpie object to a dense grid requires much more memory, so use with caution.
extend(x, gridDefinition = NULL, crop = FALSE)
x |
A magpie object |
gridDefinition |
A vector of 5 numeric values: c(xMin, xMax, yMin, yMax, resolution). Use c(-179.75, 179.75, -89.75, 89.75, 0.5) to extend to a standard 0.5-degree-resolution lon/lat grid. If NULL, use min/max of coordinates in x and guessResolution. |
crop |
If TRUE, discard cells from x which are not in the gridDefinition grid. If FALSE, throw an error if the coordinates of x are not a subset of the extended coordinates. |
Magpie object x with dense grid according to gridDefinition, gaps filled with NA.
Pascal Sauer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.