R Markdown (and friends)

M. Edward (Ed) Borasky

07/01/2014

Bestiary

  • RStudio - An Integrated Development Environment for reproducible research
  • Roxygen - In-code documentation comment system
  • Git (or subversion, if you wish) - version control
  • RPubs - A community place to publish documents
  • R Markdown - Reproducible research source document format
  • knitr - Compiles R markdown to other formats
  • Pandoc - Anything-to-anything document translator (prefers Markdown inputs)
  • LaTeX - PDF generation
  • Shiny - Interactive / reactive application framework

Three workflows

  • R package development (not covered tonight)
    • Developer writes R code with Roxygen comments
    • Packaging tools generate the documentation
  • Shiny application development (not covered tonight)
  • Reproducible research document authoring
    • Author creates an R markdown document
    • R code can be executed and replaced with its text or graphics output
    • Same R code can be shown with syntax highlighting or hidden
    • Shiny interactives can be embedded
    • knitr creates markdown intermediate
    • Pandoc creates final outputs

Reproducible document output types

  • HTML, including static websites and slide decks (like these slides!)
  • PDFs
  • Microsoft Word documents
  • Pandoc, Github, original (strict), MultiMarkdown or PHPExtra markdown
  • Can make epubs with some simple Pandoc tweaking

Lots of hooks for hackers!

  • Numerous places for interacting with knitr, e.g., languages other than R
  • Pandoc step is also highly customizable
  • New document templates and formats
  • And, of course, CSS and JavaScript (Twitter Bootstrap) tweaks