Learn R Programming

openxlsx2 (version 0.6.1)

wb_add_drawing: add drawings to workbook

Description

add drawings to workbook

Usage

wb_add_drawing(
  wb,
  sheet = current_sheet(),
  xml,
  dims = NULL,
  colOffset = 0,
  rowOffset = 0
)

Arguments

wb

a wbWorkbook

sheet

a sheet in the workbook

xml

the drawing xml as character or file

dims

the dimension where the drawing is added. Can be NULL

colOffset, rowOffset

offsets for column and row

Examples

Run this code
if (requireNamespace("rvg") && interactive()) {

## rvg example
require(rvg)
tmp <- tempfile(fileext = ".xml")
dml_xlsx(file =  tmp)
plot(1,1)
dev.off()

wb <- wb_workbook()$
  add_worksheet()$
  add_drawing(xml = tmp)$
  add_drawing(xml = tmp, dims = NULL)
}

Run the code above in your browser using DataLab