grattan_save_pptx: Save a ggplot2 chart, or list of charts, as a Powerpoint...

View source: R/grattan_save_pptx.R

grattan_save_pptxR Documentation

Save a ggplot2 chart, or list of charts, as a Powerpoint presentation

Description

'grattan_save_pptx()' creates a Grattan-style Powerpoint presentation with editable vector graphics and editable text. The title, subtitle, and caption of your graph are placed in the appropriate places. Speaker notes are included, which include the file path to the R script from which you called 'grattan_save_pptx()'. If you supply a list of plots, your Powerpoint presentation will include multiple slides – one per plot. If you specify multiple types, multiple PPTX files will be created.

Usage

grattan_save_pptx(p = ggplot2::last_plot(), filename, type = "fullslide")

Arguments

p

ggplot2 plot, or a list of ggplot2 plots

filename

Filename (including path where necessary) to save your Powerpoint presentation.

type

Chart type. If you specify multiple types, as in 'type = c("fullslide", "wholecolumn")' or 'type = "all"', multiple files will be created, with the type added to the filename.

Examples

## Not run: 
library(ggplot2)

p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
       geom_point() +
       theme_grattan() +
       labs(title = "My title",
            subtitle = "My subtitle",
            caption = "Notes: notes go here. Source: source goes here.")

grattan_save_pptx(p, "test.pptx")

## End(Not run)

grattan/grattantheme documentation built on June 28, 2023, 1:50 p.m.