Skip to contents

Returns the stage indices that have been executed for a tbl_sample. For a fully executed single-stage design, this is typically 1L. For partial execution or continuation workflows, this indicates how far the design has progressed.

Usage

get_stages_executed(x)

Arguments

x

A tbl_sample object.

Value

An integer vector of executed stage numbers.

Details

This is mainly useful for:

  • checking whether a multi-stage design was executed completely

  • writing continuation workflows that resume from the next stage

  • inspecting samples created with stages = in execute()

Examples

design <- sampling_design() |>
  add_stage("EAs") |>
    cluster_by(ea_id) |>
    draw(n = 10) |>
  add_stage("Households") |>
    draw(n = 5)

stage1 <- execute(design, bfa_eas, stages = 1, seed = 1)
get_stages_executed(stage1)
#> [1] 1

full_sample <- execute(stage1, bfa_eas, seed = 2)
get_stages_executed(full_sample)
#> [1] 1 2