Returns a named list of datasets at each step of the enrollment flow, enabling cross-cohort comparisons. Results are reported as a named list, organized by step label. Data mode only.
Arguments
- .flow
A
selectaobject created in data mode (datasupplied toenroll()).
Value
A named list of cohort snapshots, keyed by step label. Each snapshot is itself a list with:
includedA
data.tableof participants still in the flow after this step.excludedA
data.tableof participants removed at this step (for exclusion steps;NULLotherwise).n_includedInteger count of included participants.
n_excludedInteger count of excluded participants (or
NA).
Details
cohorts() replays a data mode flow and captures the dataset
at every step, returning a named list keyed by step label (with
"_start" for the initial cohort). Each snapshot exposes both the
included and the excluded rows together with their counts,
which is useful for validating a diagram against the data, auditing why
particular participants were dropped, or extracting an intermediate
population. After a stratify() or allocate()
split, the included and excluded elements of a per-arm
step are themselves named lists with one entry per arm; after a factorial
(two-level) split the entries are the cells, keyed
"<parent>: <child>". A manual-mode flow has no underlying data and
therefore raises an error. To obtain only the final analyzed population,
use cohort().