krlmlr
krlmlr

Reputation: 25444

Convert RStudio presentation (.Rpres) to rmarkdown presentation (.Rmd)

Currently there seem to be two ways to do presentations in R:

To me, it looks like the latter is slightly more powerful. The input format is very similar, yet not identical. I'm thinking about converting an RStudio presentation to rmarkdown. What's the best way to do this? How about the conversion back?

On that note, I'd really like to see an "in-pane" preview for rmarkdown presentations in RStudio, just like for RStudio presentations. I wonder why this isn't implemented -- the preview forcibly shows up in a modal window. Technical issues?

Upvotes: 12

Views: 2241

Answers (1)

Brian G. Peterson
Brian G. Peterson

Reputation: 3600

To change from .Rpres to .Rmd you need to change file extension (easy) and the front matter of the markdown document (slightly more involved).

A .Rpres file places the front matter on the first slide:

Untitled
=============================
author: Your Name Here
date: 4 July, 2015

while a .Rmd document places the front matter in a special block:

---
title: "Untitled"
author: "Your Name Here"
date: "04 July, 2015"
output: ioslides_presentation
---

The rest of your presentation code remains in rmarkdown, and should require minimal work to convert.

Some exceptions that I can think of immediately include

  • ioslides/slidify don't support columns via *** (a real shame, as this is so convenient)
  • Rpres doesn't support citations and a bibliography (also a shame)

Additionally, when converting you will need to look for any speciall CSS or other directives that are only supported by one framework.

Upvotes: 8

Related Questions