Created
March 16, 2020 18:48
-
-
Save georoen/95c5df2f265ed3503b6ba3b8eb14a398 to your computer and use it in GitHub Desktop.
updated create_pptx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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