prepare_inext: Prepare a list of (corrected) abundance vectors (iNEXT...

View source: R/prepare_inext.R

prepare_inextR Documentation

Prepare a list of (corrected) abundance vectors (iNEXT input).

Description

This function prepares input data for iNEXT function from iNEXT package (Hsieh et al., 2016)

Usage

prepare_inext(OTUs, correct_singletons = T)

Arguments

OTUs

Data frame with OTU abundances (rows = species, cols = samples) or phyloseq/otu_table object

correct_singletons

Logical, if TRUE singleton counts will be corrected with modified Good–Turing frequency formula (Chiu, Chao 2016)

Value

List of abundance vectors (each element is a separate sample)

References

Hsieh TC, Ma KH, Chao A (2016) iNEXT: an R package for rarefaction and extrapolation of species diversity (Hill numbers). Methods Ecol Evol, 7: 1451–1456. DOI 10.1111/2041-210X.12613

Chiu C, Chao A (2016) Estimating and comparing microbial diversity in the presence of sequencing errors. PeerJ, 4: e1634. DOI 10.7717/peerj.1634

Examples

# Load packages
if(!require(iNEXT)) { devtools::install_github("JohnsonHsieh/iNEXT"); library(iNEXT) }

# Load data
data(esophagus)

# Prepare input data for iNEXT
esophagus_inext <- prepare_inext(esophagus, correct_singletons = F)
esophagus_inext

# Estimate rarefied and extrapolated number of species (Hill number with order q=0)
esophagus_q0 <- iNEXT(esophagus_inext)

# Plot rarefaction curves
plot(esophagus_q0)


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.