Skip to content

spsurvey

Spatial Sampling Design and Analysis

v5.6.1 · May 4, 2026 · GPL (>= 3)

Description

A design-based approach to statistical inference, with a focus on spatial data. Spatially balanced samples are selected using the Generalized Random Tessellation Stratified (GRTS) algorithm. The GRTS algorithm can be applied to finite resources (point geometries) and infinite resources (linear / linestring and areal / polygon geometries) and flexibly accommodates a diverse set of sampling design features, including stratification, unequal inclusion probabilities, proportional (to size) inclusion probabilities, legacy (historical) sites, a minimum distance between sites, and two options for replacement sites (reverse hierarchical order and nearest neighbor). Data are analyzed using a wide range of analysis functions that perform categorical variable analysis, continuous variable analysis, attributable risk analysis, risk difference analysis, relative risk analysis, change analysis, and trend analysis. spsurvey can also be used to summarize objects, visualize objects, select samples that are not spatially balanced, select panel samples, measure the amount of spatial balance in a sample, adjust design weights, and more. For additional details, see Dumelle et al. (2023) <doi:10.18637/jss.v105.i03>.

Downloads

CRAN

1K

Last 30 days

3620th

2.8K

Last 90 days

19.4K

Last year

Trend: -6.4% (30d vs prior 30d)

r2u CRAN

8

Last 30 days

56

Last 90 days

182

Last year

Trend: -68% (30d vs prior 30d)

autoCRAN

5

Last 7 days

19

Last 30 days

1

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 12 OK · 0 NOTE · 0 WARNING · 0 ERROR · 1 FAILURE Jun 8, 2026
FAILURE r-devel-linux-x86_64-debian-gcc

DESCRIPTION meta-information

ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 7, 2026
ERROR r-devel-linux-x86_64-debian-gcc

PDF version of manual

Rd conversion errors:
Converting parsed Rd's to LaTeX ....Warning in file(out, "wt") :
  cannot open file '/tmp/RtmpJBvVWq/file176e4f1c3409a4': No space left on device
Warning in file(con, "r") :
  cannot open file '/tmp/RtmpJBvVWq/file176e4f1c3409a4': No such file or directory
Error in file(con, "r") : cannot open the connection
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE May 3, 2026
ERROR r-devel-windows-x86_64

examples

Running examples in 'spsurvey-Ex.R' failed
The error most likely occurred in:

> ### Name: cont_cdftest
> ### Title: Cumulative distribution function (CDF) inference for a
> ###   probability survey
> ### Aliases: cont_cdftest
> ### Keywords: survey

...[truncated]...
stratum", popsize = mypopsize, testname = "RaoScott_First"
+ )
Error in as.data.frame.integer(x[[i]], optional = TRUE) : 
  row names contain missing values
Calls: cont_cdftest ... data.frame -> as.data.frame -> as.data.frame.integer
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Code

Structure

Lines of code

42,352

Files

180

Compiled share

0%

Has compiled src

No

Language breakdown

R 30,311 (71.6%)Tests 5,716 (13.5%)Docs 6,212 (14.7%)Vignettes 113 (0.3%)

API

Exported functions

34

Internal functions

85

Recent export changes

v5.5.0+1 adjwgtNR

Testing & CI

Has tests

Yes

Test-to-code ratio

0.19

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

97%

\dontrun example ratio

41.4%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

22.2%

Unsafe pattern score

138

Dep constraint coverage

8.3%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5.0

System requirements

C++ standard

License

GPL (>= 3)

License flags

SPDX valid, OSI approved

History

Versions

33

First release

2007-01-22

Latest release

2026-05-04

Avg cadence

143 days

Cold removal rate

100%

Dep drift

26

LOC over versions

v1.6: 32,686 LOCv1.6.1: 32,686 LOCv1.6.2: 32,680 LOCv2.0: 36,960 LOCv2.1: 37,248 LOCv2.1-2: 37,248 LOCv2.2: 42,487 LOCv2.3: 50,508 LOCv2.4: 51,540 LOCv2.5: 52,343 LOCv2.6: 53,147 LOCv3.0: 55,209 LOCv3.1: 55,194 LOCv3.2: 53,218 LOCv3.3: 53,263 LOCv3.4: 53,340 LOCv4.0.0: 63,394 LOCv4.1.0: 45,514 LOCv4.1.1: 45,630 LOCv4.1.2: 45,606 LOCv4.1.3: 45,888 LOCv4.1.4: 45,519 LOCv5.0.0: 38,112 LOCv5.0.1: 38,219 LOCv5.1.0: 39,730 LOCv5.2.0: 39,673 LOCv5.3.0: 39,941 LOCv5.4.0: 42,829 LOCv5.4.1: 42,829 LOCv5.5.0: 43,227 LOCv5.5.1: 43,332 LOCv5.6.0: 42,352 LOCv5.6.1: 42,352 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (3)

imports

suggests

Dependency Network

Dependencies Reverse dependencies sf survey boot crossdes deldir lme4 MASS sampling units ARUtools MBHdesign secr spsurvey

Version History

34 tracked
updated 5.6.1 ← 5.6.0 diff May 4, 2026
new 5.6.0 Mar 10, 2026
updated 5.6.0 ← 5.5.1 diff Sep 29, 2025
updated 5.5.1 ← 5.5.0 diff Jan 8, 2024
updated 5.5.0 ← 5.4.1 diff May 16, 2023
updated 5.4.1 ← 5.4.0 diff Jan 15, 2023
updated 5.4.0 ← 5.3.0 diff Nov 21, 2022
updated 5.3.0 ← 5.2.0 diff Feb 24, 2022
updated 5.2.0 ← 5.1.0 diff Jan 23, 2022
updated 5.1.0 ← 5.0.1 diff Dec 14, 2021
updated 5.0.1 ← 5.0.0 diff Oct 19, 2021
updated 5.0.0 ← 4.1.4 diff Oct 17, 2021
updated 4.1.4 ← 4.1.3 diff Sep 17, 2020
updated 4.1.3 ← 4.1.2 diff Jun 17, 2020
updated 4.1.2 ← 4.1.1 diff Mar 31, 2020