| ternB | R Documentation |
Takes a list of tibbles previously created by ternD() or ternG()
and writes them all into one .docx file, one table per page, preserving
the exact formatting settings that were used when each table was built.
ternB(
tables,
output_docx,
page_break = TRUE,
methods_doc = FALSE,
methods_filename = "TernTables_methods.docx"
)
tables |
A list of tibbles created by |
output_docx |
Output file path ending in |
page_break |
Logical; if |
methods_doc |
Logical; if |
methods_filename |
Output file path for the methods document. Defaults
to |
ternB() works by replaying the exact word_export() call that
ternD() / ternG() would have made – using stored metadata
attached as an attribute to each returned tibble – but directing all output
into a single combined document instead of separate files.
Table captions (table_caption) and footnotes (table_footnote) specified in the original
ternD() / ternG() call are reproduced automatically. You can
override them by modifying the "ternB_meta" attribute before calling
ternB(), though in practice it is easier to set captions and footnotes when you
first build each table.
Invisibly returns the path to the written Word file.
data(tern_colon)
T1 <- ternD(tern_colon,
exclude_vars = "ID",
table_caption = "Table 1. Overall patient characteristics.",
methods_doc = FALSE)
T2 <- ternG(tern_colon,
group_var = "Recurrence",
exclude_vars = "ID",
table_caption = "Table 2. Characteristics by recurrence status.",
methods_doc = FALSE)
ternB(list(T1, T2),
output_docx = file.path(tempdir(), "combined_tables.docx"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.