stackSelect.Rd
Use a Raster* object to select cell values from different layers in a multi-layer Raster* object. The object to select values y
should have values between 1
and nlayers(x)
. The values of y
are rounded.
See extract
for extraction of values by cell, point, or otherwise.
# S4 method for class 'RasterStackBrick,Raster'
stackSelect(x, y, recycle=FALSE, type='index', filename='', ...)
RasterStack or RasterBrick object
Raster* object
Logical. Recursively select values (default = FALSE
. Only relevant if y
has multiple layers. E.g. if x
has 12 layers, and y
has 4 layers, the indices of the y
layers are used three times.
Character. Only relevant when recycle=TRUE
. Can be 'index' or 'truefalse'. If it is 'index', the cell values of y
should represent layer numbers. If it is 'truefalse' layer numbers are indicated by 0 (not used, NA returned) and 1 (used)
Character. Output filename (optional)
Additional arguments as for writeRaster
Raster* object