Skip to content

Instantly share code, notes, and snippets.

@georoen
Created March 16, 2020 18:48
Show Gist options
  • Save georoen/95c5df2f265ed3503b6ba3b8eb14a398 to your computer and use it in GitHub Desktop.
Save georoen/95c5df2f265ed3503b6ba3b8eb14a398 to your computer and use it in GitHub Desktop.
updated create_pptx
# modified from https://www.brodrigues.co/blog/2018-10-05-ggplot2_purrr_officer/
create_pptx <- function(plt = last_plot(), path = file.choose()){
if(!file.exists(path)) {
out <- read_pptx()
} else {
out <- read_pptx(path)
}
out %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with(value = dml(ggobj = plt), location = ph_location_fullsize()) %>%
print(target = path)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment