detct_RstCor: Detect Raster Correlation

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/detct_RstCor.R

Description

detects correlation of RasterLayers in a RasterStack

Usage

1
detct_RstCor(Stk, THvalue, returnCorTab = FALSE)

Arguments

Stk

a RasterStack

THvalue

numeric as 0.X - threshold value for correlation value of correlating layers to drop correlating layers (see details).

returnCorTab

boolean - to return either the cleaned RasterStack (FALSE) or to return the correlation table (TRUE); default= FALSE

Details

This function is used to test a RasterStack on the correlation of the RasterLayers. All RasterLayers which have a higher correlation value than 'THvalue' will be dropped from the RasterStack. E.g. if THvalue=0.9 all RasterLayers with correlation values >0.9 and < -0.9 will be dropped.

Value

returns a RasterStack with the layers correlating less than the treshold value.

Note

Author(s)

Andreas Schönberg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
### load data to compute RGB Indices
extpath <-system.file("extdata","lau_mspec.tif",package = "LEGION")
mspec <- raster::stack(extpath)
names(mspec)<- c("blue","green","red","nir")
### compute all vegetation indizes
x <-LEGION::vegInd_RGB(exp_rgb,3,2,1)
# perform Cor Test
y <- detct_RstCor(x,0.7)
names(y)
# to return the Correlation Matrix
z <- detct_RstCor(x,0.7,returnCorTab=TRUE)

SchoenbergA/LEGION documentation built on Jan. 31, 2021, 10:12 a.m.