c,GRaster-method {fasterRaster} | R Documentation |
"Stack" GRasters
Description
GRaster
s can be "stacked" using this function, effectively creating a multi-layered raster. This is different from creating a 3-dimensional raster, though such an effect can be emulated using stacking. GVector
s can be combined into a single vector. Stacks can only be created when:
All objects are the same class (either all
GRaster
s or allGVector
s).All objects have the same coordinate reference system (see crs()).
Horizontal extents are the same (see
ext()
).Horizontal dimensions are the same (see
res()
).The topology (2- or 3-dimensional) must be the same. If 3D, then all rasters must have the same number of depths and vertical extents (see
topology()
).
Data tables associated with GVector
s will be combined if each vector has a table and if each table has the same columns and data types. Otherwise, the data table will be combined using merge()
.
Usage
## S4 method for signature 'GRaster'
c(x, ...)
Arguments
x |
A |
... |
One or more |
Value
A GRaster
.
See Also
Examples
if (grassStarted()) {
# Setup
madForest2000 <- fastData("madForest2000")
madForest2014 <- fastData("madForest2014")
# Convert SpatRasters to GRasters:
forest2000 <- fast(madForest2000)
forest2014 <- fast(madForest2014)
# Combine:
forest <- c(forest2000, forest2014)
forest
nlyr(forest)
}