2 R Markdown

R Markdown is a package designed for literate R programming and is part of the RStudio IDE.

Like Sweave documents, R Markdown documents contain both text and R code.

R Markdown documents contain three main parts:

  1. The YAML header, which is akin to the header in a Latex document.
  2. Code chunks, just like Sweave.
  3. Text, just like Sweave, but written in markdown, not Latex.

There are excellent tutorials available for learning R Markdown.