Description
Functions for the design process of survey sampling, with specific tools for multi-wave and multi-phase designs. Perform optimum allocation using Neyman (1934) <doi:10.2307/2342192> or Wright (2012) <doi:10.1080/00031305.2012.733679> allocation, split strata based on quantiles or values of known variables, randomly select samples from strata, allocate sampling waves iteratively, and organize a complex survey design. Also includes a Shiny application for observing the effects of different strata splits. A paper on this package was published in the Journal of Statistical Software <doi:10.18637/jss.v114.i10>.
Downloads
563
Last 30 days
6779th
1.8K
Last 90 days
6.2K
Last year
Trend: +0.7% (30d vs prior 30d)
9
Last 30 days
52
Last 90 days
218
Last year
Trend: -78.6% (30d vs prior 30d)
r2u: no daily series yet
CRAN Check Status
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 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 29, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 25, 2026
tests
Running 'testthat.R' [9s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(optimall)
>
> test_check("optimall")
Saving _problems/test-allocate_wave-264.R
[ FAIL 1 | WARN 0 | SKIP 1 | PASS 305
...[truncated]...
d ──
Expected `output$nsample_actual` to equal `...$stratum_size`.
Differences:
2/3 mismatches (average diff: 1)
[1] 10 - 9 == 1
[3] 10 - 11 == -1
[ FAIL 1 | WARN 0 | SKIP 1 | PASS 305 ]
Error:
! Test failures.
Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
examples
Running examples in ‘optimall-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: multiwave_diagram
> ### Title: Print Summary Diagram of Multiwave Object
> ### Aliases: multiwave_diagram
>
> ### ** Examples
>
> MySurvey <- multiwave(phases = 2, waves = c(1, 3))
> multiwave_diagram(MySurvey)
Error: Please install DiagrammeR: install.packages('DiagrammeR').
Otherwise, try 'summary()'
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 9, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 2, 2026
tests
Running ‘testthat.R’ [57s/75s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(optimall)
>
> test_check("optimall")
Saving _problems/test-allocate_wave-29.R
[ FAIL 1 | WARN 0 | SKIP 1 | PASS
...[truncated]...
d ──
Expected `output$nsample_actual` to equal `...$stratum_size`.
Differences:
2/3 mismatches (average diff: 1)
[1] 10 - 11 == -1
[3] 7 - 6 == 1
[ FAIL 1 | WARN 0 | SKIP 1 | PASS 262 ]
Error:
! Test failures.
Execution halted