Description Usage Arguments Value Author(s) Examples
add a table into an rdocx object, with autofiting of width
1 2 | body_add_flextable_autofit(x, value, align = "center", pos = "after",
split = FALSE, landscape = FALSE)
|
x |
an rdocx object |
value |
|
align |
left, center (default) or right |
pos |
where to add the flextable relative to the cursor, one of "after", "before", "on" (end of line). |
split |
set to TRUE if you want to activate Word option 'Allow row to break across pages'. |
landscape |
is the table inserted in a landscape section? (default: FALSE) |
A new rdocx
object
David Hajage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
library(biostat2)
library(officer)
library(flextable)
mytable <- flextable(head(iris))
doc <- read_docx()
doc <- body_add_flextable(doc, mytable)
doc <- body_add_break(doc)
doc <- body_add_flextable_autofit(doc, mytable)
doc <- body_end_section_portrait(doc)
doc <- body_add_flextable(doc, mytable)
doc <- body_add_break(doc)
doc <- body_add_flextable_autofit(doc, mytable, landscape = TRUE)
doc <- body_end_section_landscape(doc)
print(doc, target = "toto.docx")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.