RStudio Presenter

Brian Caffo, Jeff Leek Roger Peng
December 18 2014

Department of Biostatistics
Bloomberg School of Public Health
Johns Hopkins University
Coursera Data Science Specialization

RStudio Presentation

  • RStudio created a presentation authoring tool within their development environment.
  • If you are familiar with slidify, you will also be familiar with this tool
    • Code is authored in a generalized markdown format that allows for code chunks
    • The output is an html5 presentation
    • The file index for the presenter file is .Rpres, which gets converted to an .md file and then to an html file if desired
    • There's a preview tool in RStudio and GUIs for publishing to Rpubs or viewing/creating an html file

Authoring content

  • This is a fairly complete guide
  • Quick start is
    • file then New File then R Presentation
    • (alt-f then f then p if you want key strokes)
    • Use basically the same R markdown format for authoring as slidify/knitr
      • Single quotes for inline code
      • Tripple qutoes for block code
      • Same options for code evaluation, caching, hiding etcetera

Compiling and tools

  • R Studio auto formats and runs the code when you save the document
  • Mathjax JS library is loaded by default so that $x^2$ yields \( x^2 \)
  • Slide navigation button on the preview; clicking on the notepad icon takes you to that slide in the deck
  • Clicking on more yields options for
    • Clearning the knitr cache
    • Viewing in a browser (creates a temporay html file in AppData/local/temp for me)
    • Create a html file to save where you want)
  • A refresh button
  • A zoom button that brings up a full window

Visuals

  • R Studio has made it easy to get some cool html5 effects, like cube transitions with simple options in YAML-like code after the first slide such as transition: rotate
  • You can specify it in a slide-by-slide basis

Here's the option "linear"

Hierarchical organization

Here's a subsection

Two columns

  • Do whatever for column one
  • Then put *** on a line by itself with blank lines before and after
  • Then do whatever for column two

Changing the slide font

Really changing things

  • If you know html5 and CSS well, then you can basically change whatever you want
  • A css file with the same names as your presentation will be autoimported
  • You can use css: file.css to import a css file
  • You have to create named classes and then use class: classname to get slide-specific style control from your css
    • (Or you can apply then within a <span>)
  • Ultimately, you have an html file, that you can edit as you wish
    • This should be viewed as a last resort, as the whole point is to have reproducible presentations, but may be the easiest way to get the exact style control you want for a final product

Slidify versus R Studio Presenter

Slidify

  • Flexible control from the R MD file
  • Under rapid ongoing development
  • Large user base
  • Lots and lots of styles and options
  • Steeper learning curve
  • More command-line oriented

R Studio Presenter

  • Embedded in R Studio
  • More GUI oriented
  • Very easy to get started
  • Smaller set of easy styles and options
  • Default styles look very nice
  • Ultimately as flexible as slidify with a little CSS and HTML knowledge