Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

raster.reduce

Reduce dimensionality of raster layers.


Description

Reduce the number of layers by either performing a PCA on them or by eliminating highly correlated ones.

Usage

raster.reduce(layers, method = "pca", n = NULL, thres = NULL)

Arguments

layers

Raster* object as defined by package raster.

method

Either Principal Components Analysis ("pca", default) or Pearson's correlation ("cor").

n

Number of layers to reduce to.

thres

Value for pairwise Pearson's correlation above which one of the layers (randomly selected) is eliminated.

Details

Using a large number of explanatory variables in models with few records may lead to overfitting. This function allows to avoid it as much as possible. If both n and thres are given, n has priority. If method is not recognized and layers come from raster.read function, only landcover is reduced by using only the dominating landuse of each cell.

Value

A RasterStack object.


red

IUCN Redlisting Tools

v1.5.0
GPL-3
Authors
Pedro Cardoso
Initial release
2020-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.