body_add_table_section | R Documentation |
Add a section with a table and its legend
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)
)
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 |
The docx
object doc
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.