NamesTrendRaster {greenbrown}R Documentation

Get the layer names for a TrendRaster raster brick

Description

This function returns the layer names of a raster brick that was created using TrendRaster

Usage

NamesTrendRaster(x)

Arguments

x

RasterBrick as created with TrendRaster or integer as the maximum number of breakpoints that was used when the function TrendRaster was called.

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

See Also

TrendRaster

Examples

# load a raster dataset of Normalized Difference Vegetation Index
data(ndvimap)
plot(ndvimap, 8)

# calculate trend with maximum 2 breakpoints
breaks <- 2
trendmap <- TrendRaster(ndvimap, start=c(1982, 1), freq=12, 
   method="AAT", breaks=breaks)
plot(trendmap)

# layer names of the result
NamesTrendRaster(breaks)
NamesTrendRaster(trendmap)
names(trendmap)

# now imagine you are loosing the layer names ...
names(trendmap) <- 1:11
plot(trendmap)	# X1, X2 ... is not meaningfull. How can you get the names back?

# re-create the layer names with NamesTrendRaster
names(trendmap) <- NamesTrendRaster(trendmap)
plot(trendmap)


[Package greenbrown version 2.4.3 Index]