Powerpoint is a powerful application for creating presentations, and allows you to include all sorts of text, pictures, animations and interactivity to create a compelling story. Most of the time you'll use the Powerpoint application to create slides, but if you want to include data and/or charts in your slides, in the interests of reproducibility you may want to automate the slide creation process. By using the R language with the Powerpoint API, you can recreate your slides in an instant whenever your data changes.
Asif Salam has created a nice tutorial showing how to use the RDCOMClient package to do exactly that. In the tutorial, Asif goes through the steps of creating the interactive visualization of Clint Eastwood's box office earnings shown below (and which you can also download as a PPT file):
The tutorial is in three parts:
- The basics: using the Powerpoint API to create slides and add content (with some use of VBA for animations).
- Getting data: scraping data from IMDB on Clint Eastwood films and earnings. This part isn't specific to Powerpoint, and of course you can use any data you like in a presentation.
- Creating a slide: adding elements to a slide using R objects and functions, and creating the animation.
The complete R code and data behind this animated slide is available on GitHub, and will serve as a useful starting point for your own automated slide generation.
By the way, if your needs are simpler and you just want to create static Powerpoint slides from R (with text, data, and graphics), take a look at Slidify. With Slidify, you can generate Powerpoint slides from R using just a Markdown document.
Asif Salam: Create amazing PowerPoint slides using R - The basics
Really promising, thanks! could you tell me more about static presentation and conversion Markdown document from R into .ppt file? I tried to find anything which describe how to do it.
Posted by: nicolabo | October 12, 2015 at 13:17
Hi,
.pptx file is not accessible for download.
Could you please fix it?
Warm regards,
Alex
Posted by: Alex | October 12, 2015 at 18:21
Do you know ReporteRs ? It's a nice solution for create PowerPoint slides from R !
Posted by: Victor Perrier | October 13, 2015 at 00:00
Thank you for the post!
How to convert Slidify into Powerpoint slides?
Posted by: Alexander Matrunich | October 13, 2015 at 01:06
Nice
Can we do the same with libre office suite?
Posted by: Thierry | October 13, 2015 at 01:11
I don't think you can make actual PowerPoint .ppt/.pptx slides with slidify - only html or pdf slides. But someone please correct me if I'm wrong.
Posted by: Andydolman | October 13, 2015 at 02:12
ReporteRs is great! Thanks!
Posted by: nicolabo | October 13, 2015 at 12:04
And ReporteRs doesn't rely on DCOM which is totally bound to Windows. Only one drawback - ReporteRs is based on Java, so it cannot be used in server-enabled applications, e.g. on OpenCPU. If it's not a case for you, give it a try.
Posted by: Xaxxa | October 13, 2015 at 17:17