Returns the study design recorded by set_design(), without requiring
callers to read the internal "simtablr.design" attribute directly.
On a data frame this reads the advisory attribute; on a simtab_spec or
simtab_result it reads the specification's design field, falling back
to the source data frame's attribute for a simtab_result (matching what
repro_manifest() reports as design/design_source). It does not
indicate whether the design took part in effect-measure resolution; see
resolved_from on spec$effect or design_used in repro_manifest()
for that.
Examples
cohort <- set_design(epitabl, "cohort")
design(cohort)
#> [1] "cohort"