get_pcoa: performs principal coordinate analysis (PCoA)

View source: R/method-mp_cal_pcoa.R

get_pcoaR Documentation

performs principal coordinate analysis (PCoA)

Description

performs principal coordinate analysis (PCoA)

Usage

get_pcoa(obj, ...)

## S3 method for class 'data.frame'
get_pcoa(
  obj,
  distmethod = "euclidean",
  taxa_are_rows = FALSE,
  sampleda = NULL,
  tree = NULL,
  method = "hellinger",
  ...
)

## S3 method for class 'dist'
get_pcoa(
  obj,
  distmethod,
  data = NULL,
  sampleda = NULL,
  method = "hellinger",
  ...
)

## S3 method for class 'phyloseq'
get_pcoa(obj, distmethod = "euclidean", ...)

Arguments

obj

phyloseq, the phyloseq class or dist class.

...

additional parameter, see also get_dist.

distmethod

character, the method of distance, see also distance

taxa_are_rows

logical, if feature of data is column, it should be set FALSE.

sampleda

data.frame, nrow sample * ncol factor, default is NULL.

tree

phylo, the phylo class, default is NULL, when use unifrac method, it should be required.

method

character, the standardization method for community ecologists, default is hellinger, if the data has be normlized, it shound be set NULL.

data

data.frame, numeric data.frame nrow sample * ncol features.

Value

pcasample object, contained prcomp or pcoa and sampleda (data.frame).

Author(s)

Shuangbin Xu

Examples

## Not run: 
    library(phyloseq)
    data(GlobalPatterns)
    subGlobal <- subset_samples(GlobalPatterns, 
                  SampleType %in% c("Feces", "Mock", "Ocean", "Skin"))
    pcoares <- get_pcoa(subGlobal, 
                       distmethod="euclidean",
                       method="hellinger")
    pcoaplot <- ggordpoint(pcoares, biplot=FALSE,
                            speciesannot=FALSE,
                            factorNames=c("SampleType"), 
                            ellipse=FALSE)

## End(Not run)

xiangpin/MicrobiotaProcess documentation built on Nov. 12, 2024, 2:05 p.m.