data_supplement: Create a function list that allows for supplementary tables...

View source: R/zz-api-file-output-utils.R

data_supplementR Documentation

Create a function list that allows for supplementary tables (as huxtables) to be added to a XLSX output file.

Description

This function encapsulates a excel output file as a destination for data tables. With the output of this function you can add extra data to the supplement as a new sheet, or you can write the spreadsheet to disk. When each data table is written either the table can be written silently or returned so that it is included in a knitr document. This is controlled by 'option("hide.supplementary.tables"=TRUE)'.

Usage

data_supplement(
  ...,
  filename = "supplementary-material.xlsx",
  out = ggrrr::outputter(...),
  nameGlue = "Supplementary Table {index}"
)

Arguments

...

output location options will be passed to outputter(...) to define the location of the file

filename

the xlsx filename

out

an outputter (defaults to a default outputter )

nameGlue

What will the tables be named

Value

a list of 2 functions. $add_table(hux, caption, footnote, index), which takes a huxtable, caption, and index a writes the huxtable into a supplementary. $write() which writes the collection of tables to the excel file.


terminological/ggrrr documentation built on June 15, 2024, 6:35 a.m.