get_pcoa: performs principal coordinate analysis (PCoA)

Description Usage Arguments Value Author(s) Examples

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

Description

performs principal coordinate analysis (PCoA)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

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