Create an editable slideshow (ideally PowerPoint) from R

As part of the contract, the team I work for has to create a monthly powerpoint filled with KPIs and other requested values, which is then passed on to another team who writes a performance commentary over the past months. Currently, the values ​​are created (mostly in SAS), exported to an excel file, and then copied and pasted into PowerPoint. This is an old approach that clearly needs updating.

Ideally, I would like to automate my presentation with RMarkdown and save myself the hassle of copying and pasting values. The problem is that RMarkdown from what I can see cannot create a .ppt file or other editable format that the comment team could have added without using R.

From a search on the topic, I found packages like rcom

, RDCOMclient

and R2PPT

, but they don't seem to have been recently updated or saved.

TL; DR; Need a way to make the powerpoint / slideshow in R where the text can be edited afterwards outside of R.

+3


source to share


3 answers


This can be done easily with RStudio and pandoc 2.1:

1) install Pandoc 2 from pandoc.org (this is a higher version than the one currently supplied with rstudio)

2) create a RMarkdown file in RStudio,

---
title: 'Some title'
author: 'author'
output:
  md_document: default
---

      



3) knit up to md

4) call pandoc to convert to pptx

system("cmd", input = "C:\\Users\\janvy\\AppData\\Local\\Pandoc\\pandoc -f markdown -t pptx -o myfile.pptx myfile.md" )

      

+2


source


I used to work for a company that had all their presentations linked to Excel sheets and it worked great for some broad definition of penalty.

If you have to keep Powerpoint as a presentation format, I would suggest not using R to create it. There are a few packages that make great connections to Office products, but in my experience they break easily with R packages and versions development (one I've played in the past recreated ggplot2 plots with real shapes and lines in Powerpoint, which resulted in to a huge file)



With this in mind, I would suggest that you create results programmatically and dump them in an excel spread sheet and create a presentation associated with that distribution sheet. To keep it up and running, I would make one file per month (if it's kpi). There are many good packages that create Excel spreadsheets, but I would stick with the csv files for simplicity.

0


source


I recommend you take a look at SlideMight, a utility for merging data with PowerPoint templates; both text and images, in slides and tables. Usage is similar in principle to mail merge, with some more advanced material.

Perhaps the solution for you would be to have the R program write your data to a YAML, JSON, or XML file first; then it calls the SlideMight version on the command line.

See www.slidemight.com .

Disclaimer: I am the developer and seller of SlideMight.

0


source







All Articles