Extends body_add_flextable()
by adding:
a legend (if
x
has a"legend"
attribute), viabody_add_table_legend()
an optional empty line after the table
Arguments
- doc
An
rdocx
object from officer.- x
A
flextable
object. If it has a"legend"
attribute, it is added.- bookmark
Optional. Word bookmark name for the legend.
- append_line
Whether to add an empty line after the table.
- ...
Passed to
flextable::body_add_flextable()
.
Examples
library(officer)
library(ggplot2)
ft = flextable::flextable(head(iris)) %>%
structure(legend="The iris dataset")
doc = read_docx() %>%
body_add_normal("Text before") %>%
body_add_flextable2(ft) %>%
body_add_normal("Text after")
write_and_open(doc)