Convert an Accumulation Curve from Another Package to a spacc Object
Source:R/as_spacc.R
as_spacc.RdBring an existing species accumulation curve into the spacc object system so
it can be summarised, plotted, extrapolated and compared with compare()
alongside spatial curves.
Usage
as_spacc(x, ...)
# Default S3 method
as_spacc(x, ...)
# S3 method for class 'specaccum'
as_spacc(x, ...)
# S3 method for class 'numeric'
as_spacc(x, ...)
# S3 method for class 'data.frame'
as_spacc(x, column = NULL, ...)Arguments
- x
An object to convert: a
specaccumobject fromvegan::specaccum(), a numeric vector holding one accumulation curve, or a data frame with such a curve in one column (for example the output ofRarefy::directionalSAC()orRarefy::rare_alpha()).- ...
Ignored, for method extensibility.
- column
For a data frame, the name of the column holding the curve.
NULL(default) usesN_SCR(the spatially constrained curve ofRarefy::directionalSAC()) orRarefaction(Rarefy::rare_alpha()), whichever is present.
Value
An object of class spacc with print(), summary(), plot(),
as.data.frame(), and compare() support.
Details
A specaccum object built with method = "random" stores one richness curve
per permutation in its perm matrix. Those curves become the rows of the
returned curves matrix and behave exactly like spacc seeds, so the
across-curve confidence band and the compare() permutation, bootstrap, and
AUC tests carry over unchanged. A specaccum object without a permutation
matrix (for example method = "exact" or "collector"), a numeric vector
and a data frame column each contribute a single mean curve, entry k being
the value after k sites.
Rarefy::directionalSAC(community, gradient) with a site distance matrix
as gradient orders the sites by distance from each plot in turn and
averages the collector curves; this is spacc(x, coords, method = "knn", focal_points = coords), so the two curves agree up to the order of sites
at tied distances.
Coordinates cannot be recovered from these objects, so the result carries
no coords: it is a curve container for plotting and comparison, not a
re-runnable spatial object.
References
Thouverai, E., Pavoine, S., Tordoni, E., Chiarucci, A., Ricotta, C., Rocchini, D. & Bacaro, G. (2026). Rarefy: an R package for the calculation of taxonomic, functional and phylogenetic sample-based spatially explicit rarefaction curves. Ecological Informatics, 103803. doi:10.1016/j.ecoinf.2026.103803
See also
compare() to test a converted curve against a spatial one.