raster_pca: Spatially explicit Principal Component Analysis (PCA)

Description Usage Arguments Value References

Description

Performs PCA on multi layers raster data. This function is based on rasterPCA from the RStoolbox package (Leutner et al., 2018).

Usage

1
2
3
4
raster_pca(x, nSamples = NULL, n = ceiling(ncell(x) * 0.2),
  nComp = nlayers(x), spca = FALSE, maskCheck = TRUE,
  na.action = na.exclude, scale. = TRUE, sampling_type = "regular",
  ...)

Arguments

x

RasterBrick RasterStack

nSamples

Integer or NULL. Number of pixels to sample for PCA fitting. If NULL, all pixels will be used.

n

Integer, sample size for specific sampling method sampling_type (see sp::spsample)

nComp

number of principal components to consider

spca

Logical. If TRUE, perform standardized PCA. Corresponds to centered and scaled input image. This is usually beneficial for equal weighting of all layers. (FALSE by default)

maskCheck

Logical. Masks all pixels which have at least one NA.

na.action

a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The ‘factory-fresh’ default is na.omit.

scale.

A logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. The default is FALSE for consistency with S, but in general scaling is advisable. Alternatively, a vector of length equal the number of columns of x can be supplied. The value is passed to scale.

sampling_type

Type specific sampling to be used

...

Additional arguments passed to writeRaster.

Value

RasterBrick

References

Benjamin Leutner, Ned Horning and Jakob Schwalb-Willmann (2018). RStoolbox: Tools for Remote Sensing Data Analysis. R package version 0.2.3. https://CRAN.R-project.org/package=RStoolbox


Issoufou-Liman/SpatialProbs documentation built on Oct. 30, 2019, 7:27 p.m.