body_add_flextables {WordR}R Documentation

Read Word document with bookmarks and create other Word document with rendered tables in place.

Description

This function is basically a loop wrapper around body_add_flextable function.

Usage

body_add_flextables(docxIn, docxOut, flextables, debug = F, ...)

Arguments

docxIn

String of length one; path to Word file with bookmarks OR officer::rdocx object

docxOut

String of length one; path for output Word file or NA

flextables

Named list of flextables; Tables to be inserted into the Word file

debug

Boolean of length one; If True then browser() is called at the beginning of the function

...

Parameters to be sent to other methods (mainly body_add_flextable)

Value

Path to the rendered Word file if the operation was successfull OR officer::rdocx object if docxOut is NA

Examples

library(flextable)
ft_mtcars <- flextable(mtcars)
ft_iris <- flextable(iris)
FT <- list(ft_mtcars=ft_mtcars,ft_iris=ft_iris)
body_add_flextables(
   paste(examplePath(),'templates/templateFT.docx',sep = ''),
   paste(tempdir(),'/resultFT.docx',sep = ''),
   FT)

[Package WordR version 0.3.6 Index]