get_pca: Performs a principal components analysis

Description Usage Arguments Value Examples

View source: R/method-get-pca.R

Description

Performs a principal components analysis

Usage

1
2
3
4
5
6
7
get_pca(obj, ...)

## S3 method for class 'data.frame'
get_pca(obj, sampleda = NULL, method = "hellinger", ...)

## S3 method for class 'phyloseq'
get_pca(obj, method = "hellinger", ...)

Arguments

obj

phyloseq, phyloseq class or data.frame shape of data.frame is nrow sample * ncol feature.

...

additional parameters, seeprcomp.

sampleda

data.frame, nrow sample * ncol factors.

method

character, the standardization methods for community ecologists. see decostand.

Value

pcasample class, contained prcomp class and sample information.

Examples

1
2
3
4
5
6
7
8
9
# don't run in examples
#library(phyloseq)
#data(GlobalPatterns)
#subGlobal <- subset_samples(GlobalPatterns, 
#         SampleType %in% c("Feces", "Mock", "Ocean", "Skin"))
#pcares <- get_pca(subGlobal, method="hellinger")
#pcaplot <- ggordpoint(pcares, biplot=TRUE, 
#                      speciesannot=TRUE,
#                      factorNames=c("SampleType"), ellipse=TRUE)

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.