names: Names of raster layers

Description Usage Arguments Value See Also Examples

Description

Get or set the names of the layers of a Raster* object

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'Raster'
names(x)

## S4 replacement method for signature 'Raster'
names(x)<-value

## S4 method for signature 'Raster'
labels(object)

Arguments

x

Raster* object

object

Raster* object

value

character (vector)

Value

Character

See Also

nlayers, bands

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
r <- raster(ncols=5, nrows=5)
r[] <- 1:ncell(r)
s <- stack(r, r, r)
nlayers(s)
names(s)
names(s) <- c('a', 'b', 'c')
names(s)[2] <- 'hello world'
names(s)
s
labels(s)

miraisolutions/raster documentation built on May 30, 2019, 11:41 p.m.