Learn R Programming

openxlsx2 (version 1.4)

wb_add_drawing: Add drawings to a worksheet

Description

Add drawings to a worksheet. This requires the rvg package.

Usage

wb_add_drawing(
  wb,
  sheet = current_sheet(),
  dims = "A1",
  xml,
  col_offset = 0,
  row_offset = 0,
  ...
)

Arguments

wb

A wbWorkbook

sheet

A sheet in the workbook

dims

The dimension where the drawing is added.

xml

the drawing xml as character or file

col_offset, row_offset

offsets for column and row

...

additional arguments

See Also

wb_add_chart_xml() wb_add_image() wb_add_mschart() wb_add_plot()

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