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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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 ot 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.