body_add_table_section {crosstable} | R Documentation |
Add a section with a table and its legend
Description
Add a section with a table and its legend
Usage
body_add_table_section(
doc,
x,
legend,
...,
bookmark = NULL,
title = getOption("crosstable_section_title", TRUE),
title_lvl = getOption("crosstable_section_title_level", 3),
sentence = getOption("crosstable_section_sentence", FALSE)
)
Arguments
doc |
a |
x |
a table: |
legend |
the legend to use |
... |
passed on to |
bookmark |
the bookmark to use. Defaults to the cleaned variable name of |
title |
the title to add for the section. Can also be |
title_lvl |
the title level if applicable |
sentence |
a sentence to add between the title (if applicable) and the table. If |
Value
The docx
object doc
Examples
library(officer)
read_docx() %>%
body_add_title("Description", 1) %>%
body_add_title("Population A", 2) %>%
body_add_table_section(head(iris), "The iris dataset", sentence=TRUE) %>%
body_add_table_section(crosstable(iris), "A crosstable of the iris dataset",
title=FALSE, sentence=TRUE, body_fontsize=8) %>%
write_and_open()
[Package crosstable version 0.7.0 Index]