pca: Principle Component Analysis

Description Usage Arguments Details Value Author(s) Examples

Description

pca performs a principal components analysis (using princomp function from stats package) on the given numeric data matrix and returns the results as an object of class princomp.

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'singleSpecies'
pca(x,...)

## S4 method for signature 'multipleSpecies'
pca(x,...)

## S4 method for signature 'RasterStackBrick'
pca(x,...)

Arguments

x

speciesData (either of singleSpecies or multiple Species) or a Raster object

...

additional arguments pass to princomp function

Details

pca analysis can be considered as a way to deal with multicollinearity problem and reduction of the data dimention. It returns two items in a list, data, and pca. The data contains the transoformed data into priciple components (the number of components is the same as the number of variable in the input data). You can check the pca item to see how many components (e.g., first 3) should be selected (e.g., by checking the loading table). For more information on the calculation, see the princomp function.

Value

a list including data (a data.frame or a RasterStack depending on the type of x), and pca results (output of the princomp function)

Author(s)

Babak Naimi naimi.b@gmail.com

http://r-gis.net

http://biogeoinformatics.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
filename <- system.file('external/preds.grd',package='sdmo')

r <- brick(filename)

p <- pca(r) # p is a list with two items

plot(p$pca)

biplot(p$pca)

plot(p$data)

sdmo documentation built on May 2, 2019, 5:47 p.m.

Related to pca in sdmo...