rvg (version 0.2.5)

dml: Wrap plot instructions for DrawingML plotting in Powerpoint

Description

A simple wrapper to mark the plot instructions as Vector Graphics instructions. It produces an object of class 'dml' with a corresponding method ph_with.

The function enable usage of any R plot with argument code and with ggplot objects with argument ggobj.

Usage

dml(
  code,
  ggobj = NULL,
  bg = "white",
  fonts = list(),
  pointsize = 12,
  editable = TRUE,
  ...
)

Arguments

code

plotting instructions

ggobj

ggplot object to print. argument code will be ignored if this argument is supplied.

bg, fonts, pointsize, editable

Parameters passed to dml_pptx

...

unused arguments

See Also

ph_with.dml

Examples

Run this code
anyplot = dml(code = barplot(1:5, col = 2:6), bg = "wheat")

library(officer)
doc <- read_pptx()
doc <- add_slide(doc, "Title and Content", "Office Theme")
doc <- ph_with(doc, anyplot, location = ph_location_fullsize())
fileout <- tempfile(fileext = ".pptx")
# fileout <- "vg.pptx"
print(doc, target = fileout)

Run the code above in your browser using DataCamp Workspace