Skip to contents

Writes three worksheets: a long machine-readable tidy sheet with numeric statistic cells, the formatted display sheet, and a data dictionary, named machine-readable, display, and data-dictionary. Reports write one display sheet per item instead of a single display sheet.

Usage

export_xlsx(x, path, overwrite = FALSE, ...)

Arguments

x

A SimtablR object with an as.data.frame() method.

path

Output file path. A missing .xlsx suffix is added; any other suffix is rejected.

overwrite

Logical. Existing files are protected by default; pass TRUE to replace the destination explicitly.

...

Passed to openxlsx::writeData().

Value

Invisibly returns the normalized output path.

Examples

if (FALSE) { # \dontrun{
data(epitabl)
table1(epitabl, c("age", "sex"), by = "adjudicated_acs") |>
  export_xlsx(tempfile(fileext = ".xlsx"))
} # }