Last chance! 50% off unlimited learning
Sale ends in
produces a vector graphics output from R plot instructions
and add the result in an Word document object produced
by read_docx
.
body_add_vg(x, code, pos = "after", ...)
an rdocx
object produced by officer::read_docx
plot instructions
where to add the new element relative to the cursor, one of "after", "before", "on".
arguments passed on to dml_docx
.
# NOT RUN {
library(officer)
x <- read_docx()
x <- body_add_vg(x, code = barplot(1:5, col = 2:6) )
print(x, target = "vg.docx")
# }
Run the code above in your browser using DataLab