Subset of a SpatRaster
Select a subset of layers from a SpatRaster.
## S4 method for signature 'SpatRaster' subset(x, subset, filename="", overwrite=FALSE, ...)
x |
SpatRaster |
subset |
integer or character. Should indicate the layers (represented as integer or by their names) |
filename |
character. Output filename |
overwrite |
logical. If |
... |
additional arguments for writing files as in |
SpatRaster
s <- rast(system.file("ex/logo.tif", package="terra")) subset(s, 2:3) subset(s, c(3,2,3,1)) #equivalent to s[[ c(3,2,3,1) ]] s[c("red", "green")] s$red
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.