0

See my code

library(flextable)
library(officer)
library(magrittr)

my_doc <- read_docx() 

tb = head(iris, 4)

tb <- flextable(tb)
tb <- width(tb, width = 1.1)

my_doc <- my_doc %>%
  body_add_flextable(tb, align = 'left')

print(my_doc, target = "file.docx")

Word output

enter image description here

PDF Output > same document saved as pdf

enter image description here

Arkadi w
  • 129
  • 22

0 Answers0