I am attempting to use for loops to generate and then print flextables into a Word doc using R Markdown
At first I was using print in the loop, and it returned something to the effect: “A flextable object: col_keys …” and so on, where nothing was formatted and my tables were printed as if someone typed them. I saw David’s solution from 2019:
knitr::opts_chunk$set(echo = TRUE)
library(flextable)
ft <- flextable(head(iris))
for(i in 1:3){
cat("<w:p/>")## add this to add an empty new paragraph between tables
flextable::docx_value(ft)
}
but unfortunately when I ran this I got an error:
! 'docx_value' is not an exported object from 'namespace:flextable'
Quitting from lines 14-19 [unnamed-chunk-1] (Prac.Rmd)
Execution halted```
New contributor
MLBPhillies26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.