Skip to contents

Function to place R generated figures into a PowerPoint Template

Usage

ic_pptfig(
  my_pres = NA,
  size = "letter",
  orientation = "L",
  fig = ggplot2::last_plot(),
  section = "",
  fignum,
  note = "",
  author,
  doctitle1,
  doctitle2 = "",
  doctitle3 = "",
  draft = "DRAFT",
  pc = "Privileged and Confidential",
  showpath = T
)

Arguments

my_pres

template pptx, defaults to read from read_pptx_template function

size

Presentation size: letter (default) or ledger.

orientation

Presentation orientation: landscape (L, default) or Portrait (P)

fig

graphics object that is compatible with officer, defaults to last last_plot()

section

Optional section number

fignum

Figure number after the section-figure number

note

Optional figure notes text to include under figure

author

The script author

doctitle1

Document Title 1

doctitle2

Optional Document Title 2

doctitle3

Optional Document Title 3

draft

Bold red text to be included next to figure caption, "DRAFT" is default

pc

Privileged and Confidential label, "Privileged and Confidential" is default

showpath

Show script path on page. Default is True

Value

PowerPoint presentation with added figure Note: function dml() creates an editable figure in PowerPoint fig <- dml(ggobj = p) #for ggplot object fig <- dml(grid.arrange(p1, p2, p3, p4, nrow = 4))

Examples

#' my_pres <- ic_pptfig( fig = ggplot2::ggplot(), fignum = "1", author = "J. Doe", doctitle1 = "example figure")

# Print presentation in calling script
# print(my_pres, "Output_File-Name.pptx") #must end in .pptx