ph_with.dml: add a plot output as vector graphics into a PowerPoint object

View source: R/ph_with_vg.R

ph_with.dmlR Documentation

add a plot output as vector graphics into a PowerPoint object

Description

produces a vector graphics output from R plot instructions stored in a dml object and add the result in an rpptx object produced by read_pptx.

Usage

## S3 method for class 'dml'
ph_with(x, value, location, ...)

Arguments

x

a pptx device

value

dml object

location

a location for a placeholder.

...

Arguments to be passed to methods

Examples

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")
print(doc, target = fileout)

rvg documentation built on May 31, 2023, 7:18 p.m.