Skip to content

optimall

Allocate Samples Among Strata

v1.4.0 · Apr 3, 2026 · GPL-3

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

CRAN

563

Last 30 days

6779th

1.8K

Last 90 days

6.2K

Last year

Trend: +0.7% (30d vs prior 30d)

r2u

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

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 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
ERROR r-devel-windows-x86_64

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
ERROR r-devel-linux-x86_64-debian-gcc

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
ERROR r-patched-linux-x86_64

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
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies dplyr glue magrittr rlang tibble optimall

Version History

13 tracked
updated 1.4.0 ← 1.3.1 diff Apr 3, 2026
new 1.3.1 Mar 10, 2026
updated 1.3.1 ← 1.3.0 diff Jan 27, 2026
updated 1.3.0 ← 1.2.0 diff Sep 7, 2025
updated 1.2.0 ← 1.1.1 diff Jul 16, 2025
updated 1.1.1 ← 1.1.0 diff Jun 2, 2024
updated 1.1.0 ← 0.1.5 diff Apr 12, 2024
updated 0.1.5 ← 0.1.4 diff Feb 14, 2024
updated 0.1.4 ← 0.1.3 diff Jan 11, 2024
updated 0.1.3 ← 0.1.2 diff Sep 5, 2023
updated 0.1.2 ← 0.1.1 diff Nov 8, 2022
updated 0.1.1 ← 0.1.0 diff Feb 8, 2022
new 0.1.0 Jul 20, 2021