Learn R Programming

MorphoTools2 (version 1.0.2.1)

pca.calc: Principal Component Analysis

Description

This function performs principal component analysis.

Usage

pca.calc(object)

Value

an object of class pcadata with the following elements:

objects

IDIDs of each row of scores object.
Populationpopulation membership of each row of scores object.
Taxontaxon membership of each row of scores object.
scoresordination 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

data.frame containing the means for the taxa.

rank

number of principal components.

center, scale

the centring and scaling of the input data.

Arguments

object

an object of class morphodata.

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.

Examples

Run this code
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")

Run the code above in your browser using DataLab