The R function (save_pptx()
) is a quick wrapper of functions from R pacakge officer
. It can save ggplot object to vectorized editable pptx files.
save_pptx(file="./tmp.pptx", width=8, height=8/sqrt(2), plot=last_plot())
The function had four arguments:
file=
: output file.width=
: width of the output figure.height=
: height of the output figure.plot=
: ggplot object.
source("./scripts/save_pptx.r")
library(ggplot2)
# Example
p <- ggplot() + geom_point(aes(x=1, y=1))
save_pptx(file="./results/diversity.pptx", width=5*sqrt(2), height=5, plot=p)