en:pca_r

Section: Ordination analysis

## PCA & tb-PCA (linear unconstrained ordination)

### R functions

(library`rda`

`vegan`

) - if the environmental data matrix in this function is not specified, the`rda`

function from package`vegan`

performs unconstrained ordination (PCA). To calculate tb-PCA, first pre-transform the compositional data (using`decostand`

from`vegan`

, with argument`method`

either`hellinger`

or`chord`

) and then use`rda`

function. Function`plot`

draws ordination diagram, but species are drawn like centroids, not like vectors (the same in function`ordiplot`

); use`biplot`

(library`vegan`

) to draw variables as vectors, or consider using function`cleanplot.pca`

(*from Numerical Ecology with R*, definition here), which is intended for drawing PCA results.and`prcomp`

- functions, which are a part of preinstalled library`princomp`

`stats`

. Beware:`plot`

function does not draw ordination diagram, but draws the barplot with eigenvalues (but you can use functions`ordiplot`

or`biplot`

from`vegan`

package instead).(library`pca`

`labdsv`

) - another option, how to calculate pca. The library`labdsv`

provides its own`plot.pca`

and other (e.g.`points.pca`

) functions, because the results of`pca`

function are not compatible with`ordiplot`

from`vegan`

.(P. Legendre in`PCA`

*Numerical Ecology with R*) - custom build function (called`PCA.newr`

in the second edition), with`biplot`

for ploting. You can find the definition here.

applied on the object returned by `vegan`

's function `rda`

.

(library`ordiequilibriumcircle`

`BiodiversityR`

) - adds the circle of equivalent contribution onto the ordination diagram plotted by`vegan`

's functions`ordiplot`

or`biplot`

. Note that the ordination diagram needs to be stored into an object, and the name of this object needs to come in the argument`ordiplot`

of this function.

en/pca_r.txt · Last modified: 2021/03/03 19:51 by David Zelený