Returns the Analysis Results Data (ARD) behind a table, for QC and for numeric comparison with an independently produced result, such as a SAS dataset.
Details
tlf_ard()returns the ARD: a cardscardobject, or a named list of them for a gtsummary table built in several steps.tlf_write_ard()flattens it to one row per statistic and writes CSV (or JSON, by file extension).
Examples
if (requireNamespace("cards", quietly = TRUE)) {
ard <- cards::ard_continuous(ex_adsl, by = TRT01A, variables = AGE)
f <- tempfile(fileext = ".csv")
tlf_write_ard(ard, f)
head(read.csv(f))
unlink(f)
}