
Export a publication-ready CONSORT flowchart image
Source:R/cohort_flow.R
export_consort_flowchart.RdDraws one box per attrition step (N and percent retained) and an "Excluded" box for every step with drops, straight from
the attrition table, so the figure cannot drift from the SQL counts. Uses base graphics only. The format follows the file
extension (png, svg, pdf, jpeg). Mirror of Python omop_etl.cohort.export_consort_flowchart.
Usage
export_consort_flowchart(
attrition,
out_path = "figure1.png",
title = NULL,
dpi = 300,
terminal_split = NULL
)Arguments
- attrition
A
consort_attritionobject, thecompute_attrition()data.frame, or a cohort carrying anattritionattribute.- out_path
Output file (default
"figure1.png").- title
Optional title.
- dpi
Resolution for raster formats.
- terminal_split
Optional named numeric (label = N) drawn as a row of branching outcome boxes under the last step, each with its percentage of the split total.