Description Usage Arguments Value See Also Examples
A RasterStack is a collection of RasterLayer objects with the same spatial extent and resolution. A RasterStack can be created from RasterLayer objects, or from raster files, or both. It can also be created from a SpatialPixelsDataFrame or a SpatialGridDataFrame object.
1 2 3 4 5 6 7 8 9 10 11 | ## S4 method for signature 'character'
stack(x, ..., bands=NULL, varname="", native=FALSE, RAT=TRUE, quick=FALSE)
## S4 method for signature 'Raster'
stack(x, ..., layers=NULL)
## S4 method for signature 'missing'
stack(x)
## S4 method for signature 'list'
stack(x, bands=NULL, native=FALSE, RAT=TRUE, ...)
|
x |
filename (character), Raster* object, missing (to create an empty RasterStack), SpatialGrid*, SpatialPixels*, or list (of filenames and/or Raster* objects). If |
bands |
integer. which bands (layers) of the file should be used (default is all layers) |
layers |
integer (or character with layer names) indicating which layers of a RasterBrick should be used (default is all layers) |
native |
logical. If |
RAT |
logical. If |
quick |
logical. If |
varname |
character. To select the variable of interest in a NetCDF file (see |
... |
additional filenames or Raster* objects |
RasterStack
addLayer, dropLayer, raster, brick
1 2 3 4 5 6 7 8 9 10 11 | # file with one layer
fn <- system.file("external/test.grd", package="raster")
s <- stack(fn, fn)
r <- raster(fn)
s <- stack(r, fn)
nlayers(s)
# file with three layers
slogo <- stack(system.file("external/rlogo.grd", package="raster"))
nlayers(slogo)
slogo
|
Loading required package: sp
[1] 2
[1] 3
class : RasterStack
dimensions : 77, 101, 7777, 3 (nrow, ncol, ncell, nlayers)
resolution : 1, 1 (x, y)
extent : 0, 101, 0, 77 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=merc +datum=WGS84
names : red, green, blue
min values : 0, 0, 0
max values : 255, 255, 255
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.