raster (version 1.0.4)

bands: Bands

Description

A 'band' refers to a single layer for a possibly multi-layer file. Most RasterLayer objects will refer to files with a single band. (The term 'band' is frequently used in remote sensing to refer to a variable (layer) in a multi-variable dataset and in that context bands could be stored in a single or in seperate files). nbands returns the number of bands of the file a RasterLayer points to (and 1 if it does not point at any file) 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).

Usage

band(x, ...)
nbands(x)

Arguments

x
RasterLayer object
...
Additional arguments (none at this time)

Value

  • a numeric value >= 1

See Also

nlayers

Examples

Run this code
r <- raster()
nbands(r)
band(r)

Run the code above in your browser using DataLab