Learn R Programming

ursa (version 3.9.4)

nband: Get number of bands of raster image.

Description

nband (length) returns number of bands (layers, if appropriate in terminology) of ursaRaster object.

Usage

nband(x)

# S3 method for ursaRaster length(x)

Arguments

x

Object of class ursaRaster

Value

Positive integer of length 1.

Details

length for ursaRaster object is a synonym for nband.

See Also

bandname (names for ursaRaster object).

Examples

Run this code
# NOT RUN {
session_grid(NULL)
a1 <- pixelsize()
print(a1)
print(nband(a1))
a2 <- c("Band 1"=a1,Band2=a1/2,sqrt=sqrt(a1),NA)
print(a2)
print(nband(a2))
# }

Run the code above in your browser using DataLab