body_add_flextables: Read Word document with bookmarks and create other Word...

View source: R/body_add_flextables.R

body_add_flextablesR 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)

WordR documentation built on Jan. 13, 2023, 1:12 a.m.