rvg (version 0.2.2)

body_add_vg: add a plot output as vector graphics into a Word object

Description

produces a vector graphics output from R plot instructions and add the result in an Word document object produced by read_docx.

Usage

body_add_vg(x, code, pos = "after", ...)

Arguments

x

an rdocx object produced by officer::read_docx

code

plot instructions

pos

where to add the new element relative to the cursor, one of "after", "before", "on".

...

arguments passed on to dml_docx.

Examples

Run this code
# 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 DataCamp Workspace