| rarefy | R Documentation |
Compute individual-based rarefaction curves for Hill numbers at any order q.
This complements the sample-based accumulation in spacc().
rarefy(x, n_individuals = NULL, q = 0, n_boot = 100L)
x |
A site-by-species matrix with abundance data (not presence/absence). |
n_individuals |
Integer vector. Sample sizes to compute expected
diversity for. Default |
q |
Numeric. Order of Hill number; any value |
n_boot |
Integer. Number of bootstrap replicates for CI. Default 100. |
For q=0 (species richness): uses the Hurlbert (1971) formula.
For q=1 (Shannon diversity): rarefied Shannon entropy is computed and converted to effective number of species via exponentiation.
For q=2 (Simpson diversity): rarefied Simpson concentration is computed and converted to effective number of species via inversion.
An object of class spacc_rare containing:
n |
Sample sizes |
expected |
Expected diversity (Hill number of order q) |
sd |
Standard deviation |
lower, upper |
95 percent confidence bounds |
q |
Order of diversity used |
Hurlbert, S.H. (1971). The nonconcept of species diversity: a critique and alternative parameters. Ecology, 52, 577-586.
Chao, A., Gotelli, N.J., Hsieh, T.C., et al. (2014). Rarefaction and extrapolation with Hill numbers: a framework for sampling and estimation in species diversity studies. Ecological Monographs, 84, 45-67.
abundance_matrix <- matrix(rpois(50 * 30, 2), nrow = 50)
rare <- rarefy(abundance_matrix)
plot(rare)
# Shannon rarefaction
rare_q1 <- rarefy(abundance_matrix, q = 1)
plot(rare_q1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.