en:pca_r
Section: Ordination analysis
PCA & tb-PCA (linear unconstrained ordination)
R functions
rda
(libraryvegan
) - if the environmental data matrix in this function is not specified, therda
function from packagevegan
performs unconstrained ordination (PCA). To calculate tb-PCA, first pre-transform the compositional data (usingdecostand
fromvegan
, with argumentmethod
eitherhellinger
orchord
) and then userda
function. Functionplot
draws ordination diagram, but species are drawn like centroids, not like vectors (the same in functionordiplot
); usebiplot
(libraryvegan
) to draw variables as vectors, or consider using functioncleanplot.pca
(from Numerical Ecology with R, definition here), which is intended for drawing PCA results.prcomp
andprincomp
- functions, which are a part of preinstalled librarystats
. Beware:plot
function does not draw ordination diagram, but draws the barplot with eigenvalues (but you can use functionsordiplot
orbiplot
fromvegan
package instead).pca
(librarylabdsv
) - another option, how to calculate pca. The librarylabdsv
provides its ownplot.pca
and other (e.g.points.pca
) functions, because the results ofpca
function are not compatible withordiplot
fromvegan
.PCA
(P. Legendre in Numerical Ecology with R) - custom build function (calledPCA.newr
in the second edition), withbiplot
for ploting. You can find the definition here.
applied on the object returned by vegan
's function rda
.
ordiequilibriumcircle
(libraryBiodiversityR
) - adds the circle of equivalent contribution onto the ordination diagram plotted byvegan
's functionsordiplot
orbiplot
. Note that the ordination diagram needs to be stored into an object, and the name of this object needs to come in the argumentordiplot
of this function.
en/pca_r.txt · Last modified: 2021/03/03 19:51 by David Zelený