Changelog
Source:NEWS.md
spacc 0.11.0
CRAN release: 2026-10-11
New features
-
spaccPhylo(metric = "evoheritage", rho = )accumulates EvoHeritage (Rosindell et al. 2024), phylogenetic diversity with attrition of evolutionary heritage at raterho.rho = 0reproduces Faith’s PD; a vectorrhogives one curve per rate (#7). -
chao2(x, n_units = )estimates richness for sites drawn without replacement from a finite set ofn_unitsunits (MoRE, Chiu 2023), which reaches the observed richness when every unit is sampled instead of overestimating it.extrapolate(n_units = )compares the asymptote with MoRE and uses it as the reference for the disagreement warning (#14). -
arc()estimates total richness with the accumulation rate curve estimator of Shestopaloff (2025): log-normal, log-logistic and Weibull fits to the rate at which new species appear, combined with capped weights, with a parametric bootstrap interval from a penalised Poisson mixture of the frequency counts.data = "incidence"runs it on site occupancy. The weights are the minimum of the paper’s loss reached by gradient flow from zero weights, the one the author’s reference code reaches (#13). -
spaccCoverage(coverage = "chiu", n_units = )gives the matching sample coverage: the undetected abundance uses the MoRE estimate of the undetected species, so the coverage reaches 1 when every unit is sampled (#14). -
spaccHillBeta(standardize = "coverage", coverage = )standardises gamma and alpha to a common sample coverage at every step (iNEXT.beta3D, Chao et al. 2023) and returns the four dissimilarities1-CqN,1-UqN,1-VqN,1-SqN. Final-step values matchiNEXT.beta3D::iNEXTbeta3D()(#6). -
spaccFunc(metric = "K")accumulates the aggregated functional diversity K of Wojcik et al. (2024) with its four facets (k_richness,k_biomass_evenness,k_trait_evenness,k_dispersion); K is defined from two species on (#8). -
spaccRedundancy()tracks phylogenetic or functional redundancy along the accumulation: the ratio of the taxonomic Hill number to the phylogenetic (Chao et al. 2010) or similarity-sensitive functional (Leinster & Cobbold- Hill number of the accumulated community (#9).
-
spaccBeta(pool = )repeats the turnover/nestedness partition between pooled assemblages (habitats, regions) along the same site orders, next to the site-level partition (Jones et al. 2025);summary()andplot()takeresolution = "site","pooled"or (plot)"both"(#11). -
ses(null_model = "shift_rotate")keeps the community and moves a fixed sampling design (user-suppliedfocal_pointsof aknnanalysis) by random rotations and shifts (Ridder et al. 2024), testing the design’s position rather than the community’s spatial structure (#12). -
as_spacc()converts a numeric curve or a data frame column, including the output ofRarefy::directionalSAC()andRarefy::rare_alpha().spacc(method = "knn", focal_points = coords)is checked to reproduce Rarefy’s directional curve exactly (#16). -
spaccNetwork()accumulates an interaction network over space: interaction richness and Hill numbers, sample coverage, the species curves of both levels and connectance along the same orders (Chiu et al. 2023) (#15). -
spaccFunc(itv = TRUE)takes traits per individual or population (a long table withspecies, optionalsiteand trait columns) and evaluates FDis, FRic, Rao’s Q and K on the trait rows of the accumulated sites; one row per species reproduces the species-mean curves (#17). -
dar()is an S3 generic: besides a site-by-species matrix it takes aspacc,spacc_hill,spacc_phylo,spacc_funcorspacc_redundancyobject and returns the diversity-area relationship of each of its curves, along the same site orders, with a power-law fit per curve (coef()). The area kernels are C++ (incremental convex hull, Voronoi cells), sodar()no longer needssf. The result carriescurves,metricand the curveobjectit was built from (formerlyhill) (#10). - New C++ engine for size- and coverage-based rarefaction and extrapolation of Hill numbers (
src/core/inext_core.h), matching iNEXT.3D.
Bug fixes
-
ses()onspacc_phyloandspacc_funcobjects always stopped with “Too few valid permutations”: their null analyses were never rerun. The objects now carry their tree, traits and metric settings, andses()reruns them. -
ses()reranknnanalyses with newly drawn focal points; the nulls now reuse the observed design, andspacc_betanulls keep the distance method. -
extrapolate()andcompareModels()passed unknown arguments (such asprogress = FALSE) on tonls(), which treated them as data, so every model “failed to converge”. Unknown arguments are now an error. The extrapolation vignette’s model comparison had been all failures for this reason. -
dar(area_method = "voronoi")computed bounding-box areas; it now sums the Voronoi cells of the accumulated sites. The convex-hull area of one or two sites is 0 instead of their bounding box. -
diversityProfile(tree = )scaled branch lengths by the maximum root-to-tip depth. It now uses the abundance-weighted mean depth of Chao et al. (2010), which is the same for an ultrametric tree and keeps the profile equal to the taxonomic one on a star tree otherwise. Phylogenetic and functional profiles run on the C++ kernels shared withspaccRedundancy(). -
rarefy()withq = 1orq = 2returned the Hill number of the full sample at every size (q = 1 plugged the sample proportions into Shannon, q = 2 ignored the subsample size). It now returns the expected Hill number of a random subsample at every order, matching iNEXT.3D, and extrapolates sizes above the sample size. -
extrapolateCoverage()withq = 1orq = 2interpolated the richness curve within the observed coverage and applied ad hoc corrections beyond it. It now reads the Hill curve of the requested order (aspaccHillCoverage()object; aspacc_coverageobject carriesq = 0only) and extrapolates the pooled sample with the Chao et al. (2014) estimators, which also replace the reconstructed singleton counts used forq = 0. -
spaccPhylo()PD matched species to tree tips by column position, so it was wrong whencolnames(x)were not intree$tip.labelorder and read past the community when the tree held more tips thanxhad species. Species are now matched to tips by name.
Internals
- Every accumulation method is now an order generator (
src/orders.cpp), and one kernel accumulates species along those orders (src/accumulate.cpp). The per-method serial/parallel/tree copies of the traversal (knn.cpp,kncn.cpp,random.cpp,methods.cpp,metrics.cpp) are gone;spacc(),spaccMetrics(),spaccDiversity()and the metric front doors all take their site orders from.accumulation_orders(). - The Hill, coverage, beta, phylogenetic and functional accumulations run on one templated worker (
OrderMetricWorkerinsrc/parallel_utils.h); each metric is a small struct with anat_step()method. The pure kernels live insrc/core/(phylo_core.handfunc_core.hare new) and are the single implementation behind both the exported single-community functions (calc_mpd(),calc_fdis(), …) and the accumulation workers. - Faith’s PD precomputes the parent of every tree node once per call instead of scanning the edge list at every step.
- The S3 methods of the curve classes share
.curve_stats(),.curve_frame(),.plot_curves_by(),.plot_site_map()and.as_sf_site_values(); theautoplot()methods are one delegating function registered per class. -
spaccobjects carry the siteorderstheir curves were accumulated along.
Behaviour changes
-
method = "gaussian"draws from R’s random number generator, soseed(orset.seed()) now reproduces its curves. It previously used an unseeded C++ generator. -
method = "kncn"withdistance = "haversine"measures centroid distances with the haversine formula on both backends; the exact backend used planar distances on longitude/latitude. -
.accumulation_orders()computes a distance matrix only for the methods that need one, sospaccHill(),spaccPhylo(),spaccFunc(),spaccCoverage()andspaccEndemism()no longer build ann x nmatrix for the fixed-focusknnmethod. -
as_sf()andplot(type = "map")on an object computed withoutmap = TRUEfail with one message for every class: “No map data. Rerun() with map = TRUE.”
spacc 0.10.2
API Changes
method = "knn"now implements fixed-focus spatially constrained rarefaction: continuous focal points are sampled from the spatial domain and all sites are ranked by distance from each focus. Supplyfocal_domainfor a known polygonal study boundary orfocal_pointsfor exact focal coordinates. The former greedy current-site traversal is nowmethod = "nn_walk".method = "radius"was removed because its observed-site fixed-focus ordering duplicated the correctedknnconcept.spaccWavefront()remains the radius-indexed accumulation front door.Diversity, coverage, beta, phylogenetic, functional, endemism, metric, and diversity-area calculations now consume shared site-order matrices. This keeps the selected spatial rule identical across downstream quantities.
Spatial-accumulation curves use the
spaccWavefront()front door. The distance- and area-relationship functions keep their established names:distanceDecay(),betaDecay(),zetaDiversity(), anddar().spaccBeta()gainstraitsandtreearguments and computes taxonomic, functional, or phylogenetic beta diversity from a single front door. Supplyingtraitsgives the trait-weighted Baselga partition; supplyingtreegives the branch-length-weighted (PhyloSor) partition.diversityProfile()gainstraitsandtreearguments and computes taxonomic, functional (Leinster-Cobbold), or phylogenetic (Chao et al.) Hill profiles from a single front door.
New Features
extrapolateArea()extrapolates richness to a spatial extent larger than the one sampled, using the total-species (T-S) curve of Ugland, Gray & Ellingsen (2003): sites are partitioned into spatial subareas, the expected total richness of random subarea combinations is plotted against their convex-hull area, and an asymptotic model is fitted and extended to a target area with a median-bias-corrected site-bootstrap interval. Newspacc_areaclass withprint()/summary()/plot()/predict()/as.data.frame()methods.extrapolate()gains a calibratedinterval = "bootstrap"(now the default) that refits the chosen model across resampled seed curves and returns percentile bounds, replacing the over-confidentnlsprofile interval as the default.predict(fit, interval = "bootstrap")returns a prediction band, andplot()draws it.interval = "profile"recovers the old behaviour.extrapolate()now reports goodness of fit (residual RMSE over the observed range), an extrapolation-range note, and the nonparametricchao2()/iChao2()estimates alongside the asymptote. It warns when the asymptote exceeds the observed richness by more thanwarn_ratio(default 2), when it disagrees withchao2()by more than 50%, and whenpredict()is evaluated beyond ~2.5x the sampled effort.
Bug Fixes
plot()on aspacc_endemismobject no longer lists “Endemic species” twice in the legend. The confidence-band fill was drawn as its own guide because the ribbon covered only the endemism series; that fill guide is now suppressed so a single line-colour legend remains.Removed a stray blank line beneath the y-axis title in
plot()forspacc_betaobjects.extrapolate()asymptote confidence intervals are no longer over-confident. The previousconfint()used annlsprofile interval on the (ultra-smooth) mean curve, ignoring across-seed variability; it could exclude the truth in every replicate of a recovery simulation.confint()now returns the calibrated bootstrap interval by default (method = "profile"is still available). The documentation notes that the parametric asymptote can be biased high on clustered or under-sampled data and points to the nonparametric estimators for calibrated total-richness intervals (#1, #3, #5).
Testing
- Added parameter-recovery and CI-coverage tests on data simulated with a known truth: richness estimators recover the true pool size (jackknife intervals at ~nominal coverage; chao/iChao near-unbiased),
extrapolate()recovers truth on near-saturation data,extrapolateArea()interpolates the observed area, and the Hill, phylogenetic, functional, and coverage accumulation endpoints match their defining formulae (#2).
spacc 0.8.3
CRAN release: 2026-06-20
Documentation
- Expanded all seven vignettes from brief overviews into full worked guides (quickstart, diversity, rarefaction/standardization, community assembly, spatial analysis, extrapolation, richness estimation). Each now covers the underlying model, simulation with known ground truth, fitting, uncertainty, prediction/comparison, and practical guidance, and exercises the full exported API (including
evenness(),diversityProfile(),spatialEigenvectors()/spatialPartition(),wavefront(), andcompareModels()).
spacc 0.8.2
Improvements
-
spaccDiversity()objects gain a dedicatedplot()method with a metric-neutral default y-axis label (“Cumulative diversity”) and aylab/titleargument, so custom-metric curves are no longer labelled as species counts.
spacc 0.8.1
Improvements
-
spaccPhylo()andspaccFunc()now accept non-integer abundances (e.g. cover or biomass) for Rao’s Q and FDis weighting. The phylogenetic and functional accumulation backends use double-precision community matrices instead of truncating to integers. Presence-based metrics (MPD/MNTD/PD/FRic) are unaffected.
spacc 0.8.0
New Features
Rao’s Quadratic Entropy (v0.8.0)
-
spaccPhylo()andspaccFunc()gain a"rao"metric: abundance-weighted mean pairwise distance (phylogenetic cophenetic distance, or Euclidean trait distance), accumulated along the spatial curve. -
spaccPhylo()no longer binarises its input, so abundance data now weights Rao; presence metrics (MPD/MNTD/PD) are unchanged. - Exact-math recovery tests against the Rao definition
sum_i sum_j p_i p_j d_ij.
Custom Diversity Metrics (v0.8.0)
-
spaccDiversity()accumulates any user-supplied index along a spatial ordering: at each step the cumulative community is passed to a function that returns a scalar. Supportsknn,kncn,nn_walk,random, andcollectororderings, abundance or incidence input, and extra arguments. - Returns a
spacc_diversityobject inheritingspacc, so the standardsummary(),plot(),as.data.frame(), andpredict()methods apply.
Arbitrary-Order Rarefaction (v0.8.0)
-
rarefy()now accepts anyq >= 0(q = 0, 1, 2 keep their exact estimators; other orders report the Hill number of orderq) instead of silently falling back to richness.
spacc 0.7.1
New Features
User-Defined Accumulation Order (v0.7.1)
-
spacc()gains anorderargument for supplying an explicit accumulation sequence, bypassing distance computation and seed sampling.- Accepts a single ordering vector, a list of vectors, or a matrix with one ordering per row (each row treated like a seed for uncertainty bounds).
- Each ordering must be a permutation of
seq_len(nrow(x)). - Backed by
cpp_order_parallel(), which reuses the random-accumulation worker with caller-supplied orderings.
spacc 0.7.0
New Features
Hill Numbers (v0.2.0)
-
spaccHill()- Spatial accumulation with Hill numbers (q = 0, 1, 2)- q = 0: Species richness
- q = 1: Exponential Shannon entropy (effective common species)
- q = 2: Inverse Simpson (effective dominant species)
- Extends iNEXT framework to spatial accumulation
Spatial Beta Diversity (v0.3.0)
-
spaccBeta()- Beta diversity accumulation with partitioning- Total beta diversity (Sorensen or Jaccard)
- Turnover component (species replacement)
- Nestedness component (species loss)
- Based on Baselga (2010) framework
Coverage-Based Rarefaction (v0.4.0)
-
spaccCoverage()- Track sample coverage during accumulation -
interpolateCoverage()- Interpolate richness at target coverage levels - Implements Chao & Jost (2012) Good-Turing coverage estimator
Phylogenetic/Functional Diversity (v0.5.0)
-
spaccPhylo()- Phylogenetic diversity accumulation- MPD: Mean Pairwise Distance
- MNTD: Mean Nearest Taxon Distance
-
spaccFunc()- Functional diversity accumulation- FDis: Functional Dispersion
- FRic: Functional Richness (approximation)
Per-Site Metrics & Heatmaps (v0.6.0)
-
spaccMetrics()- Extract accumulation metrics per site-
slope_10,slope_25: Initial accumulation slopes -
half_richness,richness_Npct: Sites to reach richness thresholds -
auc: Area under accumulation curve
-
-
as_sf()- Convert metrics to sf for spatial analysis - Heatmap plotting via
plot(type = "heatmap")
Spatial Support Integration (v0.7.0)
- New
supportparameter inspacc()for areaOfEffect integration- Accepts country names:
spacc(species, coords, support = "France") - Accepts sf polygons or pre-computed
aoe_resultobjects
- Accepts country names:
- Seeds sampled from core sites only (inside support)
- Accumulation expands into halo sites (buffer zone) by default
-
include_halo = FALSEfor hard/political boundaries - Eliminates edge effects at arbitrary administrative boundaries
spacc 0.1.0
Initial release.
Features
Core Spatial Accumulation Methods
-
spacc()- Main function with multiple spatial sampling methods:-
knn: k-Nearest Neighbor (always visit closest unvisited) -
kncn: k-Nearest Centroid Neighbor (visit closest to centroid) -
random: Random order (null model) -
radius: Expand by distance from seed -
gaussian: Probabilistic selection weighted by distance -
cone: Directional expansion within angular constraint -
collector: Sites in data order
-
Additional Accumulation Methods
-
wavefront()- Expanding radius accumulation -
distanceDecay()- Distance-decay relationships
Analytical Methods (No Simulation)
-
coleman()- Coleman expected accumulation -
mao_tau()- Mao Tau (exact) expected accumulation -
collector()- Collector’s curve (data order) -
spatialRarefaction()- Spatially-constrained rarefaction
Analysis Functions
-
extrapolate()- Fit asymptotic models (Michaelis-Menten, Lomolino, etc.) -
compare()- Statistical comparison between curves -
rarefy()- Rarefaction to common effort -
subsample()- Subsample sites spatially