Converts a sampling design object to a plain list representation, useful for inspection, serialization, or export.

# S3 method for class 'sampling_design'
as.list(x, ...)

Arguments

x

A sampling_design object

...

Additional arguments (ignored)

Value

A list representation of the design containing:

  • title: The design title (if any)

  • stages: A list of stage specifications

Examples

design <- sampling_design(title = "Household Survey") |>
  stratify_by(region, alloc = "proportional") |>
  draw(n = 500)

as.list(design)
#> $title
#> [1] "Household Survey"
#> 
#> $stages
#> $stages[[1]]
#> $stages[[1]]$strata
#> $stages[[1]]$strata$vars
#> [1] "region"
#> 
#> $stages[[1]]$strata$alloc
#> [1] "proportional"
#> 
#> 
#> $stages[[1]]$draw
#> $stages[[1]]$draw$n
#> [1] 500
#> 
#> $stages[[1]]$draw$method
#> [1] "srswor"
#> 
#> 
#> 
#>