pca.calc {MorphoTools2} | R Documentation |
Principal Component Analysis
Description
This function performs principal component analysis.
Usage
pca.calc(object)
Arguments
object |
an object of class |
Details
The pca.calc
function performs an R type principal component analysis using the R base princomp
function. Principal component analysis is a variable reduction procedure. It reduces original variables into a smaller number of principal components (artificial variables) that will account for most of the variance in the observed variables.
Value
an object of class pcadata
with the following elements:
objects |
ID | IDs of each row of scores object. |
|
Population | population membership of each row of scores object. |
|
Taxon | taxon membership of each row of scores object. |
|
scores | ordination scores of cases (objects, OTUs). | |
eigenVectors |
matrix of eigenvectors (i.e., a matrix of characters loadings). |
eigenValues |
eigenvalues of principal components, i.e., proportion of variation of the original dataset expressed by individual axes. |
eigenvaluesAsPercent |
eigenvalues as percent, percentage of their total sum. |
cumulativePercentageOfEigenvalues |
cumulative percentage of eigenvalues. |
groupMeans |
|
rank |
number of principal components. |
center , scale |
the centring and scaling of the input data. |
Examples
data(centaurea)
centaurea = naMeanSubst(centaurea)
centaurea = removePopulation(centaurea, populationName = c("LIP", "PREL"))
pcaRes = pca.calc(centaurea)
summary(pcaRes)
plotPoints(pcaRes, axes = c(1,2), col = c("red", "green", "blue", "black"),
pch = c(20,17,8,21), pt.bg = "orange", legend = TRUE, legend.pos = "bottomright")