vccs
Vue 3용 차트 컴포넌트 모음, Recharts에서 포팅
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Fast spatial species accumulation curves with C++ performance
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Spatial species accumulation curves built by fixed-focus expansion in C++.
Sample a focal point in continuous space, rank every sampling unit by its distance from
that point, then count new species along the ranking. spacc repeats this from many focal
points (Rcpp/RcppParallel backend), so the curve carries a confidence ribbon showing how
richness depends on where expansion begins.
The classical curve in vegan::specaccum() shuffles sites in random order, without using
their spatial arrangement.README 전문 보기 ↗species accumulating in the neighbourhood
spacc builds species accumulation curves that add sampling sites in the order of their distance from a starting point, such as plots added one by one outward from a point in a survey region, and shows how the curve changes with that point.
The classical curve of specaccum() in
vegan adds sites in random order,
without using their spatial arrangement. spacc samples a focal point in
continuous space, ranks every site by its distance from that point and
counts the new species along the ranking. It repeats this from many
focal points in C++ with RcppParallel, so the curve carries a confidence
ribbon showing how richness depends on where the expansion begins. spacc
also computes the random-order curve, so you can compare the two and
judge how much the spatial arrangement of your sites matters.
spacc supports:
knn),
nearest-centroid expansion (kncn), a nearest-neighbour walk
(nn_walk), distance- and direction-weighted growth (gaussian,
cone), the classical random order (random) and the data order
(collector).spaccHill()
is the entry point.distance = "haversine" works on
longitude and latitude with no projection step, and an sf polygon
through focal_domain restricts the focal points to a known study
boundary.extrapolate()
fits asymptotic richness models, including Michaelis-Menten, Lomolino,
Weibull, logistic and extreme value models, and compare() tests two
curves by permutation, bootstrap or area under the curve.Existing curves from vegan::specaccum() enter through as_spacc(), so
they share the plotting and comparison methods. Each method follows a
published definition, listed with its reference in the DESCRIPTION and
in Methods and
Algorithms, and a
methods section can cite those papers for the estimators and spacc for
the spatial ordering.
Install the released version from CRAN. Windows and macOS get a binary that needs no build tools:
install.packages("spacc")
The development version compiles C++ code. Install the build tools for your operating system first:
| Operating system | Build tools |
|---|---|
| Windows | Rtools matching your R version |
| macOS | Run xcode-select --install in Terminal |
| Debian / Ubuntu | Install r-base-dev |
Check that R can find the compiler:
pkgbuild::has_build_tools(debug = TRUE)
Then install spacc from GitHub:
# install.packages("pak")
pak::pak("gcol33/spacc")
The build needs GNU make and a C++17 compiler, which the build tools above provide. The nanoflann library ships as a header inside the package, and RcppParallel brings its own threading library, so no system libraries are needed.
spacc() from a
site-by-species matrix and the site coordinates.method = "random" and test the
difference with compare().extrapolate(), or follow other diversity
measures with spaccHill() and spaccBeta().The input is a matrix or data frame with one row per site and one column
per species, holding presence-absence or abundance, and the site
coordinates as a data frame with columns x and y or an sf object of
points. Coordinates are planar by default; distance = "haversine"
reads x and y as longitude and latitude in degrees.
In the example below, each of 40 species occurs around its own position along the x axis, so neighbouring sites share species:
library(spacc)
set.seed(1)
coords <- data.frame(x = runif(200), y = runif(200))
centres <- runif(40)
prob <- outer(coords$x, centres, function(x, m) exp(-(x - m)^2 / 0.02))
species <- matrix(rbinom(length(prob), 1, prob), nrow = 200)
sac <- spacc(species, coords)
plot(sac)
The line is the mean over 50 focal points, and the ribbon holds 95% of the curves from single focal points.
Adding the sites in random order instead reaches the species far faster, because it ignores that neighbouring sites share species:
sac_random <- spacc(species, coords, method = "random")
compare(sac, sac_random)
#> Comparison: sac vs sac_random
#> ----------------------------------------
#> Method: permutation (n=999)
#> AUC difference: -1028.1 (p < 0.001***)
#> Saturation: sac at 90 sites, sac_random at 10 sites
#>
#> sac_random saturates faster.
Each diversity function carries the spatial ordering through to a
different measure, with map = TRUE for per-site values and as_sf()
for GIS output:
hill <- spaccHill(species, coords, q = c(0, 1, 2), map = TRUE)
plot(hill, type = "map", q = 0)
beta <- spaccBeta(species, coords, index = "sorensen")
plot(beta, partition = TRUE)
Diversity Accumulation covers Hill numbers, the alpha, beta and gamma partition, and phylogenetic and functional diversity.
groups splits the species into groups, such as native and alien
species or families, and accumulates each under the same spatial site
order. time adds a temporal axis to the distance, weighted against
space with w_space and w_time:
sac_grouped <- spacc(species, coords, groups = status, seed = 42)
plot(sac_grouped, facet = TRUE)
sac_st <- spacc(species, coords, method = "nn_walk",
time = site_years, w_space = 1, w_time = 0.5)
Community Assembly and Turnover applies grouped curves to community structure.
Start with Getting Started with spacc: one path from a site-by-species matrix to spatial and random-order curves, their comparison and extrapolation.
Questions and bug reports go to the GitHub issues. A bug report is easiest to act on with a small reproducible example, for instance made with reprex.
Pull requests are welcome; see the contributing guide.
“Software is like sex: it’s better when it’s free.” — Linus Torvalds
I’m a PhD student who builds R packages in my free time because I believe good tools should be free and open. I started these projects for my own work and figured others might find them useful too.
If this package saved you some time, buying me a coffee is a nice way to say thanks. It helps with my coffee addiction.
The k-d tree search uses
nanoflann by Marius Muja,
David G. Lowe and Jose Luis Blanco, bundled in inst/include.
spacc is licensed under MIT. The bundled nanoflann library is licensed
under BSD; inst/COPYRIGHTS lists its copyright holders.
Colling G (2026). _spacc: Fast Spatial Species Accumulation Curves_.
doi:10.32614/CRAN.package.spacc
<https://doi.org/10.32614/CRAN.package.spacc>. R package version
0.11.0, <https://gillescolling.com/spacc/>.
BibTeX:
@Manual{colling2026spacc,
title = {spacc: Fast Spatial Species Accumulation Curves},
author = {Gilles Colling},
year = {2026},
note = {R package version 0.11.0},
url = {https://gillescolling.com/spacc/},
doi = {10.32614/CRAN.package.spacc},
}