TrendSegmentsRaster: Identify for each multi-temporal raster layer the number of...

Description Usage Arguments Details Value Author(s) Examples

Description

Imagine you have a multi-temporal raster brick with 30 years of data. Now you compute trends using the function TrendRaster, which will return the timing of breakpoints as well as the slopes and p-values in each trend segment. But now you want to know for each pixel and each time step if it belongs to the first, second or Nth trend segment. For this you can use this function!

Usage

1
2
3
4
5
6
TrendSegmentsRaster(trend.rb, 
    start = c(1982, 1), 
    end = c(2011, 12), 
    freq = 12, min.length = 0, 
    max.pval = 0.05, 
    ...)

Arguments

trend.rb

multi-layer raster object of class brick as computed with TrendRaster

start

beginning of the time series (i.e. the time of the first observation). The default is c(1982, 1), i.e. January 1982 which is the usual start date to compute trends on long-term series of satellite observations of NDVI. See ts for further examples.

end

end of the time series (i.e. the time of the last observation). The default is c(2008, 12), i.e. December 2008 as the last observation

freq

The frequency of observations. The default is 12 for monthly observations. Use 24 for bi-monthly observations, 365 for daily observations or 1 for annual observations. See ts for further examples.

min.length

Minimum duration of a trend in time steps of the input raster (see Details).

max.pval

Maximum p-value to classify a trend as being significant.

...

additional arguments as for writeRaster

Details

This function expects a RasterBrick as created with TrendRaster as input and assigns for each pixel and each time step the number of the trend segment. If a trend is not significant too short the time step will be flagged with NA. Per default a p-value of 0.05 is used to classify trends as significant. Additionally, the minimum duration of a trend can be specified with min.length: For example, if only time series segments longer than 10 years should be considered as trend, set min.length=11 in case of annual data. In case of monthly data set it to 132 (12 observations per year * 11 years)

Value

The function returns a RasterBrick.

Author(s)

Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 
# # calculate trend
# trendmap <- TrendRaster(ndvimap, start=c(1982, 1), freq=12, method="AAT", breaks=2)
# plot(trendmap)
# 
# # indicate for each time step the trend segment number
# trendsegmentsmap <- TrendSegmentsRaster(trendmap, min.length=5, max.pval=0.05, 
# 	start=c(1982, 1), end=c(2011, 1), freq=1)
# plot(trendsegmentsmap, 1:2, col=c("blue", "red")) 
# # first 2 years: everthing belongs to time series segment 1 
# plot(trendsegmentsmap, 29:30, col=c("blue", "red")) 
# # last 2 years: most pixel belong still to first time series segment 
# # (i.e. no breakpoints were detected), but some pixels are in the second 
# # time series segment (i.e. after the first breakpoint) 

greenbrown documentation built on Dec. 18, 2020, 3:02 p.m.