Generate per-site rarefaction curves (expected richness vs. sample size)
using vegan::rarefy (i.e., the same computation as
vegan::rarecurve, but without any plotting side-effects).
Value
A data frame with columns:
SiteIDFactor identifying the site (from
abund_matrix$site).SampleSizeNumber of individuals subsampled.
RarefiedRichnessExpected species richness at that sample size.
Details
The result is returned in long (tidy) format with one row per site x
sample size point. The SampleSize values come from the Subsample
attribute attached by vegan::rarefy.
Examples
if (FALSE) { # \dontrun{
rr <- calculate_rarefaction(abund_matrix)
head(rr)
} # }