Learn R Programming

rrtable (version 0.1.0)

add_2flextables: Add two flextables into a document object

Description

Add two flextables into a document object

Usage

add_2flextables(mydoc, ft1, ft2, echo = FALSE, width = 3, code = "")

Arguments

mydoc

A document object

ft1

The first flextable

ft2

The second flextable

echo

whether or not display R code

width

plot width in inches

code

R code string

Value

a document object

Examples

Run this code
# NOT RUN {
require(rrtable)
require(officer)
require(magrittr)
title="Two Tables"
ft1=df2flextable(head(iris[1:4]))
ft2=df2flextable(tail(iris[1:4]))
doc=read_docx()
doc %>% add_text(title=title) %>%
        add_2flextables(ft1,ft2) %>%
        print(target=paste0(tempdir(),"/","2tables.docx"))
# }

Run the code above in your browser using DataLab