nlayers

0th

Percentile

Number of layers

Get the number of layers in a Raster* object, typically used with a (multilayer) RasterStack or RasterBrick object

Keywords
spatial
Usage
nlayers(x)
Arguments
x

Raster* object

Value

integer

See Also

names

Aliases
  • nlayers
  • nlayers,BasicRaster-method
  • nlayers,Raster-method
  • nlayers,RasterStack-method
  • nlayers,RasterBrick-method
  • nlayers,Spatial-method
Examples
# NOT RUN {
r <- raster(ncols=10, nrows=10)
r[] <- 1:ncell(r)
s <- stack(r, r, r)
nlayers(s)
s <- stack(s,s)
nlayers(s)
s <- dropLayer(s, 2:3)
nlayers(s)

# }
Documentation reproduced from package raster, version 2.8-4, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.