Skip to contents

spacc 0.11.0

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 (OrderMetricWorker in src/parallel_utils.h); each metric is a small struct with an at_step() method. The pure kernels live in src/core/ (phylo_core.h and func_core.h are 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(); the autoplot() methods are one delegating function registered per class.
  • spacc objects carry the site orders their curves were accumulated along.

Behaviour changes

  • method = "gaussian" draws from R’s random number generator, so seed (or set.seed()) now reproduces its curves. It previously used an unseeded C++ generator.
  • method = "kncn" with distance = "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, so spaccHill(), spaccPhylo(), spaccFunc(), spaccCoverage() and spaccEndemism() no longer build an n x n matrix for the fixed-focus knn method.
  • as_sf() and plot(type = "map") on an object computed without map = TRUE fail 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. Supply focal_domain for a known polygonal study boundary or focal_points for exact focal coordinates. The former greedy current-site traversal is now method = "nn_walk". method = "radius" was removed because its observed-site fixed-focus ordering duplicated the corrected knn concept. 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(), and dar().

  • spaccBeta() gains traits and tree arguments and computes taxonomic, functional, or phylogenetic beta diversity from a single front door. Supplying traits gives the trait-weighted Baselga partition; supplying tree gives the branch-length-weighted (PhyloSor) partition.

  • diversityProfile() gains traits and tree arguments 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. New spacc_area class with print()/summary()/plot()/predict()/as.data.frame() methods.

  • extrapolate() gains a calibrated interval = "bootstrap" (now the default) that refits the chosen model across resampled seed curves and returns percentile bounds, replacing the over-confident nls profile interval as the default. predict(fit, interval = "bootstrap") returns a prediction band, and plot() 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 nonparametric chao2()/iChao2() estimates alongside the asymptote. It warns when the asymptote exceeds the observed richness by more than warn_ratio (default 2), when it disagrees with chao2() by more than 50%, and when predict() is evaluated beyond ~2.5x the sampled effort.

Bug Fixes

  • plot() on a spacc_endemism object 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() for spacc_beta objects.

  • extrapolate() asymptote confidence intervals are no longer over-confident. The previous confint() used an nls profile 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(), and compareModels()).

spacc 0.8.2

Improvements

  • spaccDiversity() objects gain a dedicated plot() method with a metric-neutral default y-axis label (“Cumulative diversity”) and a ylab/title argument, so custom-metric curves are no longer labelled as species counts.

spacc 0.8.1

Improvements

  • spaccPhylo() and spaccFunc() 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() and spaccFunc() 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. Supports knn, kncn, nn_walk, random, and collector orderings, abundance or incidence input, and extra arguments.
  • Returns a spacc_diversity object inheriting spacc, so the standard summary(), plot(), as.data.frame(), and predict() methods apply.

Arbitrary-Order Rarefaction (v0.8.0)

  • rarefy() now accepts any q >= 0 (q = 0, 1, 2 keep their exact estimators; other orders report the Hill number of order q) instead of silently falling back to richness.

spacc 0.7.1

New Features

User-Defined Accumulation Order (v0.7.1)

  • spacc() gains an order argument 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 support parameter in spacc() for areaOfEffect integration
    • Accepts country names: spacc(species, coords, support = "France")
    • Accepts sf polygons or pre-computed aoe_result objects
  • Seeds sampled from core sites only (inside support)
  • Accumulation expands into halo sites (buffer zone) by default
  • include_halo = FALSE for hard/political boundaries
  • Eliminates edge effects at arbitrary administrative boundaries

Internal Changes

  • New C++ implementations: hill.cpp, beta.cpp, coverage.cpp, phylo.cpp, metrics.cpp
  • cpp_knn_parallel_seeds() - legacy nearest-neighbour walk with explicit seed indices
  • Added sf, areaOfEffect, ape, iNEXT, betapart to Suggests

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)

Analysis Functions

Infrastructure

  • C++ backend via Rcpp for performance
  • Parallel processing via RcppParallel
  • Haversine distance support for geographic coordinates