Generate per-site rarefaction curves (expected richness vs. sample size)
using vegan::rarecurve
.
Value
A data frame with columns:
SiteID
Factor identifying the site (from
abund_matrix$site
).SampleSize
Number of individuals subsampled.
RarefiedRichness
Expected 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 provided by vegan::rarecurve
.
Examples
if (FALSE) { # \dontrun{
rr <- calculate_rarefaction(abund_matrix)
head(rr)
} # }