Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

save_as_docx

save flextable objects in an Word file


Description

sugar function to save flextable objects in an Word file.

Usage

save_as_docx(..., values = NULL, path, pr_section = NULL)

Arguments

...

flextable objects, objects, possibly named. If named objects, names are used as titles.

values

a list (possibly named), each element is a flextable object. If named objects, names are used as titles. If provided, argument ... will be ignored.

path

Word file to be created

pr_section

a prop_section object that can be used to define page layout such as orientation, width and height.

See Also

Examples

tf <- tempfile(fileext = ".docx")

library(officer)
ft1 <- flextable( head( iris ) )
save_as_docx(ft1, path = tf)


ft2 <- flextable( head( mtcars ) )
sect_properties <- prop_section(
  page_size = page_size(orient = "landscape",
    width = 8.3, height = 11.7),
  type = "continuous",
  page_margins = page_mar()
)
save_as_docx(`iris table` = ft1, `mtcars table` = ft2,
  path = tf, pr_section = sect_properties)

flextable

Functions for Tabular Reporting

v0.6.10
GPL-3
Authors
David Gohel [aut, cre], Clementine Jager [ctb], Quentin Fazilleau [ctb], Maxim Nazarov [ctb] (rmarkdown for docx output), Titouan Robert [ctb], Michael Barrowman [ctb] (inline footnotes), Atsushi Yasumoto [ctb] (support for bookdown cross reference), Paul Julian [ctb] (support for gam objects)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.