names

0th

Percentile

Names of raster layers

Get or set the names of the layers of a Raster* object Function layerNames is deprecated. Use names in stead.

Keywords
spatial
Usage
## S3 method for class 'Raster':
names(x)

## S3 method for class 'Raster':
names(x)<-value

layerNames(x)
layerNames(x) <- value
Arguments
x
Raster* object
value
Character (vector)
Value

  • Character

See Also

nlayers, bands

Aliases
  • layerNames
  • layerNames<-
  • names
  • names<-
  • names,Raster-method
  • names<-,Raster-method
Examples
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
Documentation reproduced from package raster, version 2.0-04, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.