View source: R/prepare_inext.R
prepare_inext | R Documentation |
This function prepares input data for iNEXT
function from iNEXT package (Hsieh et al., 2016)
prepare_inext(OTUs, correct_singletons = T)
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) |
List of abundance vectors (each element is a separate sample)
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
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.