Learn R Programming

flextable (version 0.4.5)

body_add_flextable: add flextable into a Word document

Description

add a flextable into a Word document.

Usage

body_add_flextable(x, value, align = "center", pos = "after")

Arguments

x

an rdocx object

value

flextable object

align

left, center (default) or right.

pos

where to add the flextable relative to the cursor, one of "after", "before", "on" (end of line).

Examples

Run this code
# NOT RUN {
library(officer)
ft <- flextable(head(mtcars))
ft <- theme_zebra(ft)
# }
# NOT RUN {
ft <- autofit(ft)
# }
# NOT RUN {
doc <- read_docx()
doc <- body_add_flextable(doc, value = ft)
# }
# NOT RUN {
print(doc, target = "test.docx")
# }

Run the code above in your browser using DataLab