Skip to contents

saveAllGraphsInList2pptx: a nifty function that saves into a PowerPoint file all the graphics given in a list (Possibly with titles if given in an additional list). Requires packages rsv and officer.

Usage

saveAllGraphsInList2pptx(
  list2Save,
  titles4list2Save = NULL,
  file2Save.pptx = "PowerpointFromR",
  title = NULL,
  addGraphNames = TRUE
)

Arguments

list2Save

A list with graphics (that could have been created by ggplot2 or by Recordplot).

titles4list2Save

A list (with the same number of items as list2Save) that will serve as the title of the graphs. When NULL (default) the title of the graph will the name of the graph in list2Save.

file2Save.pptx

(default = "PowerpointFromR") 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: "Graphics from R" + date.

addGraphNames

when TRUE (default) put titles in the powerpoint slides; if titles have been provided in titles4list2Save these will be used, if not the name of the graphs is used for the title of the slide.

Value

a list (of class "save2pptx") with listOfsavedGraphs (the list of the graph objects saved) and nameOfSavingFile4pptx

(name of the file 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

Hervé Abdi

Examples

if (FALSE) {
 # Example from data4PCCAR
data("sixBeers12Descriptors10Judges", package = 'data4PCCAR')
df <- sixBeers12Descriptors10Judges$ratingsIntensity
res4graph <- graph4epPCA(data = df, scale = FALSE)
}