Skip to contents

Deprecated, use officer::sheet_add_drawing() with a dml() object instead.

Usage

xl_add_vg(x, sheet, code, left, top, width, height, ...)

Arguments

x

an rxlsx object produced by officer::read_xlsx

sheet

sheet label/name

code

plot instructions

left, top

left and top origin of the plot on the sheet in inches.

height, width

Height and width in inches.

...

arguments passed on to dml_xlsx.

Examples

# \donttest{
library(officer)
my_ws <- read_xlsx()
my_ws <- sheet_add_drawing(my_ws,
  value = dml(code = barplot(1:5, col = 2:6)),
  sheet = "Feuil1",
  width = 6, height = 6, left = 1, top = 2
)
fileout <- tempfile(fileext = ".xlsx")
print(my_ws, target = fileout)
# }