flextable (version 0.5.11)

docx_value: flextable Office Open XML string for Word

Description

get openxml raw code for Word from a flextable object.

The function is particularly useful when you want to generate flextable in a loop from a R Markdown document. By default, the output is printed and is returned as a character scalar.

When used inside an R Markdown document, chunk option results must be set to 'asis'.

Arguments ft.align and ft.split can be specified also as knitr chunk options.

Usage

docx_value(
  x,
  print = TRUE,
  ft.align = opts_current$get("ft.align"),
  ft.split = opts_current$get("ft.split"),
  bookdown = FALSE
)

Arguments

x

a flextable object

print

print output if TRUE

ft.align

flextable alignment, supported values are 'left', 'center' and 'right'.

ft.split

Word option 'Allow row to break across pages' can be activated when TRUE.

bookdown

TRUE or FALSE (default) to support cross referencing with bookdown.

See Also

Other flextable print function: as_raster(), htmltools_value(), knit_print.flextable(), plot.flextable(), print.flextable(), save_as_docx(), save_as_html(), save_as_image(), save_as_pptx()

Examples

Run this code
# NOT RUN {
docx_value(flextable(iris[1:5,]))
# }

Run the code above in your browser using DataCamp Workspace