c,GRaster-method {fasterRaster}R Documentation

"Stack" GRasters

Description

GRasters 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. GVectors can be combined into a single vector. Stacks can only be created when:

Data tables associated with GVectors 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 GRaster or a GVector.

...

One or more GRasters, one or more GVectors, a list of GRasters, or a list of GVectors. You can use a mix of lists and individual rasters or vectors.

Value

A GRaster.

See Also

add<-, terra::c(), add<-

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)

}

[Package fasterRaster version 8.4.0.3 Index]