estimate_richness: Summarize alpha diversity

Description Usage Arguments Value See Also Examples

View source: R/extend_vegan.R

Description

Performs a number of standard alpha diversity estimates, and returns the results as a data.frame. Strictly speaking, this function is not only estimating richness, despite its name. It can operate on the cumulative population of all samples in the dataset, or by repeating the richness estimates for each sample individually. NOTE: You must use untrimmed datasets for meaningful results, as these estimates (and even the “observed” richness) are highly dependent on the number of singletons. You can always trim the data later on if needed, just not before using this function.

Usage

1
estimate_richness(physeq, split = TRUE, measures = NULL)

Arguments

physeq

(Required). phyloseq-class, or alternatively, an otu_table-class. The data about which you want to estimate the richness.

split

(Optional). Logical. Should a separate set of richness estimates be performed for each sample? Or alternatively, pool all samples and estimate richness of the entire set.

measures

(Optional). Default is NULL, meaning that all available alpha-diversity measures will be included. Alternatively, you can specify one or more measures as a character vector of measure names. Values must be among those supported: c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson", "Fisher").

Value

A data.frame of the richness estimates, and their standard error.

See Also

Check out the custom plotting function, plot_richness, for easily showing the results of different estimates, with method-specific error-bars. Also check out the internal functions borrowed from the vegan package:

estimateR

diversity

fisherfit

Examples

1
2
3
4
5
6
7
8
9
## There are many more interesting examples at the phyloseq online tutorials.
## http://joey711.github.com/phyloseq/plot_richness-examples
 data("esophagus")
 # Default is all available measures
 estimate_richness(esophagus)
 # Specify just one:
 estimate_richness(esophagus, measures="Observed")
 # Specify a few:
 estimate_richness(esophagus, measures=c("Observed", "InvSimpson", "Shannon", "Chao1"))

Example output

  Observed    Chao1  se.chao1      ACE   se.ACE  Shannon   Simpson InvSimpson
B       28 39.14286  8.224252 49.09697 4.123723 2.249367 0.8313718   5.930206
C       33 37.50000  4.103809 40.94645 3.100302 2.762389 0.9033449  10.346062
D       38 71.00000 19.321782 88.97684 6.506711 2.032493 0.6657493   2.991766
     Fisher
B  8.803673
C 10.098927
D 13.278349
  Observed
B       28
C       33
D       38
  Observed    Chao1  se.chao1  Shannon InvSimpson
B       28 39.14286  8.224252 2.249367   5.930206
C       33 37.50000  4.103809 2.762389  10.346062
D       38 71.00000 19.321782 2.032493   2.991766

phyloseq documentation built on Nov. 8, 2020, 6:41 p.m.