saveGraph2pptx: saves all the graphics present in the Global Environment into...

View source: R/saveAllGraphsIntPptx.R

saveGraph2pptxR Documentation

saves all the graphics present in the Global Environment into a PowerPoint file.

Description

saveGraph2pptx: a nifty function that saves all the graphics present in the Global Environment (i.e., .GlobalEnv) into a PowerPoint file. Requires packages rsv and officer. Graphics saved are only those created with recordPlot() or ggplot2.

Usage

saveGraph2pptx(file2Save.pptx, title = NULL, addGraphNames = FALSE)

Arguments

file2Save.pptx

the name of the PowerPoint file for saving the graphs. If this file already exists, the old file is renamed and a warning message is printed in the console.

title

main title of the PowerPoint file. default: "All Graphics for Current Analysis. As of:" + date.

addGraphNames

when TRUE: use the name of the graph as its title for the PowerPoint slide (default is FALSE).

Value

a list (of class "savePptx") with listOfsavedGraphs (the list of the graph objects saved) and nameOfSavingFile4pptx (name of the files where the graphics are saved). Note: to print one of the graphs from nameOfSavingFile4pptx, use print(get()). For example, to print the first graph of the list saved as listOfGraph use print(get(listOfGraph$listOfsavedGraphs[[1]])).

Author(s)

Hervé Abdi

Examples

## Not run: 
toto <- saveGraph2pptx("myFile.pptx", "Pretty Graphs of the Day")

## End(Not run)

HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.