Last chance! 50% off unlimited learning
Sale ends in
nbands
returns the number of bands of the file that a RasterLayer points to (and 1 if it does not point at any file). This functions also works for a RasterStack for which it is equivalent to nlayers
.
band
returns the specific band the RasterLayer refers to (1 if the RasterLayer points at single layer file or does not point at any file).nbands(x)
band(x, ...)
nlayers
r <- raster()
nbands(r)
band(r)
Run the code above in your browser using DataLab