PCA | R Documentation |
Function that performs principal component analysis on an abundance matrix.
PCA(x, cor, dim) ## Default S3 method: PCA(x, cor = FALSE, dim = min(nrow(x), ncol(x))) ## S3 method for class 'Dataset' PCA(x, cor = FALSE, dim = min(nrow(x$Tab), ncol(x$Tab)))
x |
Numeric matrix where samples are columns and rows are species, or a
Dataset object, see |
cor |
logical value indicating whether the correlation matrix should be used instead of the covariance matrix. |
dim |
Number of dimensions to return. |
This function is the same as function pca
from the
labdsv
package, but includes a methdod for Dataset objects.
A PCA
object. Includes the same attributes as a
pca
object from the labdsv
package.
When the Dataset method is used, it includes two additional slots:
"Map"The Mapping file for the samples.
"Tax"The Taxonomic information of the taxa.
Sur from Dangl Lab.
create_dataset, pca, PCO, pco, plotgg.pca
data(Rhizo) data(Rhizo.map) Dat <- create_dataset(Rhizo,Rhizo.map) Dat.pca <- PCA(Dat) plotgg(Dat.pca,col="accession",shape="fraction",point_size=4,biplot=TRUE) summary(Dat.pca)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.