Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

officer package function for adding an R plot to a presentation

I am working on transfering my plots to a presentation using officer package in R.

A ggplot can be transferred using the ph_with_gg() function but what is the function to transfer normal R plots? I am not finding any such function in the package.

These are few of the resouces that I am refering:

officer CRAN package

PowerPoint presentations generation

Your help will be appreciated!

Regards

like image 672
Jawairia Avatar asked Mar 04 '18 05:03

Jawairia


1 Answers

Save the plot you want to output as, say, a png file then use the ph_with_img function to place the image into your presentation.

The on-line help for the Powerpoint component of officer shows how to do this - see https://davidgohel.github.io/officer/articles/powerpoint.html which you already referred to in your post.

If you don't know how to save a plot as an image please see (for example) this thread: how to save a plot as image on the disk

like image 67
Stewart Ross Avatar answered Sep 23 '22 12:09

Stewart Ross