Written and maintained by CASRAI Editorial Board
Last updated
iNEXT (interpolation and extrapolation) is an open-source R package developed by T. C. Hsieh, K. H. Ma, and Anne Chao for quantifying and comparing biodiversity across ecological assemblages. It computes seamless rarefaction and extrapolation curves for Hill numbers (species richness, Shannon diversity, and Simpson diversity) using sample-size-based and coverage-based standardization with bootstrap confidence intervals.
What it is used for in research
Ecological and computational biology investigations frequently require comparing species diversity across distinct sampling sites, treatment regimes, or time intervals. However, empirical field studies and environmental sequencing runs rarely achieve exhaustive sampling. In a sampling vs census framework, observed species richness correlates directly with sampling effort: larger sample collections inevitably yield more observed taxa than smaller samples.
Traditional rarefaction resolves sampling disparities by down-sampling larger collections to match the smallest sample size. While statistically valid, this down-sampling approach discards valuable biological data and systematically distorts diversity rankings. Because species-rich communities accumulate individuals and sample completeness at different rates than species-poor communities, comparing assemblages at an arbitrary fixed number of individuals often yields misleading rank reversals.
The iNEXT package implements a unified statistical framework established by Chao et al. (2014) and Hsieh et al. (2016) based on Hill numbers (effective number of species). Hill numbers parameterize diversity through the order parameter q, which controls sensitivity to relative species abundances:
- Order q = 0 (Species Richness, 0D): Weights all species equally regardless of their relative frequency. This metric is sensitive to rare taxa and singletons.
- Order q = 1 (Shannon Diversity, 1D): Represents the exponential of Shannon entropy. It weights species in direct proportion to their abundances and can be interpreted as the effective number of typical or common species in the community.
- Order q = 2 (Simpson Diversity, 2D): Represents the inverse of the Simpson concentration index. It discounts rare species and is dominated by highly abundant or dominant taxa.
Beyond traditional sample-size rarefaction, iNEXT implements coverage-based rarefaction and extrapolation. Sample coverage (Ĉ), derived from Alan Turing’s frequency estimation, represents the proportion of total individuals in an assemblage belonging to detected species. Standardizing comparisons at a uniform level of sample completeness (for example, 90% or 95% coverage) rather than an arbitrary individual count satisfies the mathematical replication principle, eliminates down-sampling data loss, and enables fair cross-community comparisons. Researchers routinely integrate iNEXT into bioinformatics and conservation workflows alongside phylogenetic tools such as IQ-TREE phylogenetics software and biodiversity data networks like Symbiota biodiversity portals.
Install or access
The iNEXT package is maintained by Anne Chao and distributed via the Comprehensive R Archive Network (CRAN). It requires R version 3.4 or higher and imports core statistical and visualization dependencies including ggplot2, Rcpp, reshape2, and stats.
To install the stable CRAN release within an interactive R console or script:
install.packages("iNEXT")
library(iNEXT)
library(ggplot2)
Researchers requiring bleeding-edge bug fixes or pre-release features can install the development version directly from GitHub using devtools:
# Optional installation of development version
if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
devtools::install_github("JohnsonHsieh/iNEXT")
library(iNEXT)
For researchers, educators, and field biologists who do not code in R, the authors maintain an official interactive Shiny web interface, iNEXT Online, hosted through National Tsing Hua University. The web application allows users to upload comma-separated or tab-delimited abundance matrices, compute sampling curves, and export publication-ready plots directly from standard web browsers.
Step-by-step task
This tutorial demonstrates how to format community data, calculate rarefaction and extrapolation curves, plot multi-panel comparisons, and extract standardized diversity estimates using the built-in spider abundance dataset.
1. Prepare and Inspect Input Data
iNEXT accepts three specific input data structures:
datatype = "abundance": Individual-based count data. Inputs can be a single numeric vector of species abundances, a data frame/matrix where rows represent species and columns represent assemblages, or a list of abundance vectors.datatype = "incidence_freq": Sampling-unit-based incidence counts. The first element of each vector must be the total number of sampling units (T), followed by the detection frequencies (Yi) of each observed species.datatype = "incidence_raw": A binary presence/absence (0/1) matrix where rows are species and columns are sampling units.
Load the built-in spider dataset and inspect sample attributes with DataInfo():
# Load package and example spider data
library(iNEXT)
library(ggplot2)
data(spider)
# Summary of sampling attributes
summary_info <- DataInfo(spider, datatype = "abundance")
print(summary_info)
2. Run iNEXT Interpolation and Extrapolation
Execute the core iNEXT() function across Hill orders q = 0, 1, and 2:
# Compute rarefaction and extrapolation curves
inext_out <- iNEXT(
x = spider,
q = c(0, 1, 2),
datatype = "abundance",
endpoint = 500,
knots = 40,
se = TRUE,
conf = 0.95,
nboot = 50
)
The endpoint argument sets the maximum sample size for extrapolation. By default (when set to NULL), iNEXT extrapolates up to double the observed reference sample size (2n). The knots argument dictates how many sample-size evaluation points are calculated along each trajectory (default: 40), while nboot = 50 specifies the number of bootstrap iterations used to derive 95% confidence bands.
3. Visualize Sampling Trajectories with ggiNEXT
iNEXT provides a dedicated ggplot2 wrapper, ggiNEXT(), supporting three distinct visualization types:
# Type 1: Sample-size-based rarefaction/extrapolation curve
p1 <- ggiNEXT(inext_out, type = 1, facet.var = "Order.q", color.var = "Assemblage") +
theme_bw() +
labs(x = "Number of Individuals", y = "Diversity")
print(p1)
# Type 2: Sample completeness curve (Coverage vs Sample Size)
p2 <- ggiNEXT(inext_out, type = 2, color.var = "Assemblage") +
theme_bw() +
labs(x = "Number of Individuals", y = "Sample Coverage")
print(p2)
# Type 3: Coverage-based rarefaction/extrapolation curve
p3 <- ggiNEXT(inext_out, type = 3, facet.var = "Order.q", color.var = "Assemblage") +
theme_bw() +
labs(x = "Sample Coverage", y = "Diversity")
print(p3)
4. Extract Standardized Estimates for Manuscripts with estimateD
When reporting diversity tables in academic papers, comparing continuous curves can be cumbersome. The estimateD() function calculates Hill numbers at a standardized benchmark level of sample size or sample coverage:
# Standardize diversity at 90% sample coverage (C_target = 0.90)
standardized_coverage <- estimateD(
spider,
datatype = "abundance",
base = "coverage",
level = 0.90,
conf = 0.95
)
print(standardized_coverage)
Output and how to read it
The primary object returned by iNEXT() is an S3 list of class iNEXT comprising three main data components:
$DataInfo: Provides a foundational data overview for each assemblage, listing the observed sample size (n), observed species richness (S.obs), sample coverage estimate (SC), singletons (f1, species with count = 1), and doubletons (f2, species with count = 2). For incidence data, it reports sampling units (T) and incidence singletons/doubletons (Q1,Q2).$iNextEst: Contains diversity estimates and bootstrap confidence intervals across the evaluation knots. From version 3.0.0 onward, this component is subdivided into:$size_based: Diversity estimates indexed by sample size m. Columns includeAssemblage,Order.q,m,method(indicating interpolated, observed, or extrapolated), estimated diversity (qD), 95% lower/upper confidence limits (qD.LCL,qD.UCL), and estimated coverage (SC,SC.LCL,SC.UCL).$coverage_based: Diversity estimates indexed by sample coverage, providing coverage-standardized confidence intervals.
$AsyEst: Details asymptotic diversity estimates for infinite sample size. It presents observed diversity alongside non-parametric asymptotic estimators (ChaoRichness for q = 0, ChaoShannon for q = 1, and ChaoSimpson for q = 2), accompanied by standard errors (s.e.) and 95% confidence bounds.
When interpreting curves generated by ggiNEXT(), solid lines indicate interpolation (rarefaction across sampled individuals), dashed lines represent extrapolation into uncollected individuals, and shaded ribbons denote 95% bootstrap confidence intervals. Non-overlapping confidence ribbons at a standardized coverage level indicate statistically significant diversity differences at α = 0.05.
Troubleshooting
When applying iNEXT to diverse ecological datasets, researchers commonly encounter several runtime warnings and syntax errors. The following solutions resolve these operational issues:
- Error: “Invalid data type or non-integer counts detected”: iNEXT requires non-negative integer count data for individual-based abundances. Relative abundance matrices, normalized percentages, or decimal sequence abundances produce mathematical errors during combinatoric factorial evaluation. If your data were normalized by sequencing depth, revert to raw unstandardized integer counts before running
iNEXT(). - Distorted Incidence Richness (Missing T Parameter): In
datatype = "incidence_freq", omitting total sampling units as the first entry causes iNEXT to interpret the first species detection count as the number of sampling units T. Always verify thatx[1]contains total sampling units (e.g., number of traps or quadrats), or convert raw 0/1 incidence matrices using the helper functionas.incfreq(). - Diverging Confidence Ribbons during Extrapolation: When extrapolating species richness (q = 0) beyond double the observed sample size (2n), confidence intervals expand rapidly and asymptotic estimates may exhibit wide variance. Chao et al. (2014) demonstrated that non-parametric extrapolation is mathematically reliable only up to 2n. Constrain
endpoint <= 2 * n, or switch to coverage-based comparisons where extrapolation stabilizes more quickly. - Zero Doubletons (f2 = 0) in Sparse Communities: In highly sparse collections where singletons occur but no species is observed exactly twice, standard Good-Turing coverage estimates can yield mathematical division singularities. iNEXT automatically detects f2 = 0 and applies the Chao et al. (2014) modified bias correction. Ensure your dataset contains at least n ≥ 2 individuals.
- Plot Facet Casing Errors in ggiNEXT: The
ggiNEXT()function uses strict case-sensitive parameter matching. Specifying lowercase strings such asfacet.var = "order.q"orcolor.var = "assemblage"triggers an invalid argument error. Use exact title-case naming:facet.var = "Order.q",facet.var = "Assemblage", orfacet.var = "None".
Free alternatives
Several free and open-source R packages provide specialized capabilities for diversity estimation and ecological community analysis. The table below outlines how iNEXT compares with key alternatives in the statistical ecology ecosystem:
| Package | Primary Framework | Diversity Indices | Rarefaction & Extrapolation | Coverage Standardization | Best Research Application |
|---|---|---|---|---|---|
| iNEXT | Hill numbers (Chao et al., 2014) | Orders q = 0, 1, 2 (Richness, Shannon, Simpson) | Interpolation and extrapolation up to 2n with bootstrap CIs | Yes (integrated coverage curves and estimateD) |
Standardizing taxonomic alpha diversity across assemblages with unequal sample sizes or sampling efforts. |
| vegan | Classical ecological statistics | Shannon, Simpson, Fisher alpha, Pielou evenness | Sample-size rarefaction only (rarefy, rarecurve); no extrapolation |
No built-in coverage standardization | Comprehensive multivariate community ecology: ordination (NMDS, RDA), PERMANOVA, and dissimilarity matrices. |
| entropart | Tsallis entropy and HCDT diversity | Generalized diversity profiles across continuous q values | Rarefaction supported through analytical bias corrections | Yes (incorporates Chao-Shen coverage estimation) | Rigorous mathematical partitioning of generalized diversity into alpha, beta, and gamma components. |
| hillR | Taxonomic, phylogenetic, and functional Hill numbers | Hill numbers across continuous q | No rarefaction or extrapolation engine | No coverage-based standardization | Rapid calculation of multi-dimensional Hill diversity metrics without constructing sampling curves. |
| iNEXT.3D | Chao 3D biodiversity framework | Taxonomic, Phylogenetic (PD), and Functional Diversity (FD) | Rarefaction and extrapolation for all three diversity dimensions | Yes (coverage-based standardization for 3D diversity) | Multi-faceted ecological studies combining taxonomic identities, trait matrices, and phylogenetic trees. |
When publishing research that relies on community analysis pipelines, documenting software provenance is critical for computational reproducibility. Research teams should formalize package metadata using CodeMeta standards and consider depositing novel computational tools in venues such as the Journal of Open Source Software (JOSS), aligning with broader institutional standards outlined in the research tools and software pillar.
FAQ
What is the difference between size-based and coverage-based rarefaction in iNEXT?
Size-based rarefaction compares diversity at a fixed number of sampled individuals or units, which penalizes diverse assemblages because they accumulate individuals more slowly than depauperate communities. Coverage-based rarefaction standardizes assemblages by sample completeness (estimated sample coverage Ĉ), comparing diversity when an equal proportion of each community has been observed.
Why should diversity extrapolation not exceed double the sample size (2n)?
Non-parametric extrapolation of species richness (q = 0) relies on information gathered from rare species (singletons and doubletons). Statistical derivation proves that prediction variance escalates exponentially beyond double the reference sample size (2n or 2T), rendering confidence intervals excessively wide and estimates unreliable.
What are Hill numbers and why does iNEXT use them?
Hill numbers represent diversity in units of “effective number of species”—the number of equally abundant species needed to produce the observed diversity value. They unify species richness (q = 0), Shannon diversity (q = 1), and Simpson diversity (q = 2) on a linear scale that obeys the replication principle, preventing non-linear distortions common to raw entropy metrics.
How do I cite the iNEXT package in an academic manuscript?
In academic manuscripts, cite the methodological application paper: Hsieh, T. C., Ma, K. H., & Chao, A. (2016). iNEXT: an R package for rarefaction and extrapolation of species diversity (Hill numbers). Methods in Ecology and Evolution, 7(12), 1451–1456. Additionally, cite the foundational theoretical paper by Chao et al. (2014) in Ecological Monographs.
Sources
- Chao, A., Gotelli, N. J., Hsieh, T. C., Sander, E. L., Ma, K. H., Colwell, R. K., & Ellison, A. M. (2014). Rarefaction and extrapolation with Hill numbers: a framework for sampling and estimation in species diversity studies. Ecological Monographs, 84(1), 45–67. https://doi.org/10.1890/13-0133.1 (Date checked: 2026-11-10).
- Comprehensive R Archive Network (CRAN). (2026). Package ‘iNEXT’: Interpolation and Extrapolation for Species Diversity (Version 3.0.2). https://cran.r-project.org/package=iNEXT and reference manual https://cran.r-project.org/web/packages/iNEXT/refman/iNEXT.html (Date checked: 2026-11-10).
- Hsieh, T. C., Ma, K. H., & Chao, A. (2016). iNEXT: an R package for rarefaction and extrapolation of species diversity (Hill numbers). Methods in Ecology and Evolution, 7(12), 1451–1456. https://doi.org/10.1111/2041-210X.12613 (Date checked: 2026-11-10).
- Chao Lab, National Tsing Hua University. (2026). iNEXT Software and Online User Guides. https://sites.google.com/view/chao-lab-website/software/inext (Date checked: 2026-11-10).







