grid2mopa: Transform a grid or multigrid to a set of predictors to be...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/grid2mopa.R

Description

Transform a grid or multigrid to collections of raster files for modeling with the mopa package.

Usage

1
grid2mopa(grid, crs = NA)

Arguments

grid

Input grid or multigrid without member or runtime dimensions. Grids returned by function climatology are also supported.

crs

Optional (Default NA). Character or object of class CRS. PROJ.4 type description of a Coordinate Reference System (map projection). If this argument is missing, and the x coordinates are withing -360 .. 360 and the y coordinates are within -90 .. 90, "+proj=longlat +datum=WGS84" is used. Also see under Details if x is a character (filename).

Details

Function grid2mopa generates a raster object for each time unit in the "time" dimension, for instance, if time dimension length is 12 (e.g. monthly data), a RasterStack of 12 rasters is obtained. Functions in transformeR allow to operate over the grids in order to obtain the desired temporal means (etc.) at the desired temporal resolution.

Value

A raster/RasterStack for grid objects and a list of rasters/RasterStacks for multigrids.

Author(s)

M. Iturbide

See Also

climatology; loadGridData

Examples

1
2
3
4
5
6
7
8
# A raster stack from a multigrid
data("EOBS_Iberia_tas")
data("EOBS_Iberia_pr")
multigrid <- makeMultiGrid(EOBS_Iberia_tas, EOBS_Iberia_pr)
multigridaggr <- aggregateGrid(multigrid, aggr.y = list(FUN = "mean"))
ras <- grid2mopa(multigridaggr)
require(sp)
spplot(ras$rr)

SantanderMetGroup/transformeR documentation built on Feb. 14, 2020, 5:55 p.m.