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.