R Markdown is an authoring format that enables easy creation of dynamic documents, presentations, and reports from R. It combines the core syntax of markdown (an easy-to-write plain text format) with embedded R code chunks that are run so their output can be included in the final document. R Markdown documents are fully reproducible (they can be automatically regenerated whenever underlying R code or data changes).
To learn how to use R Markdown, visit our extensive R Markdown development center at rmarkdown.rstudio.com.
There you will find an introduction to R Markdown, as well as:
-
Markdown Basics, which describes the most commonly used markdown constructs.
-
R Code Chunks, which goes into more depth on customizing the behavior of embedded R code.
-
R Markdown Cheat Sheet (PDF), a quick guide to the most commonly used markdown syntax, knitr options, and output formats.
-
R Markdown Reference Guide (PDF), a more comprehensive reference guide to markdown, knitr, and output format options.
-
Bibliographies and Citations, which describes how to include references in R Markdown documents.
-
Interactive Documents with Shiny, which describes how to make R Markdown documents interactive using Shiny.
-
Compiling Notebooks, which describes how to compile HTML, PDF, or MS Word notebooks from R scripts.
-
Document output formats: HTML, PDF, Word, Markdown, and Tufte Handout.
For even more in-depth documentation see:
-
The website for the knitr package. Knitr is an extremely powerful tool for dynamic content generation and the website has a wealth of documentation and examples to help you utilize it to its full potential.
-
The full specification of Pandoc Markdown, which describes all of the markdown features and syntax available within R Markdown documents.
-
If you are migrating documents from R Markdown v1 or wish to continue using RMarkdown v1 see the article on Migrating from R Markdown v1.
See also the R Markdown developer documentation including:
-
Creating re-usable Document Templates
-
Guide to Creating New Formats for R Markdown
-
Adding interactive components to R Markdown documents using HTML Widgets and Shiny Widgets.
While using RMarkdown in RStudio, with R-3.1.2, I found the following bug:
Symptom: would not generate a PDF document.
Error: the file rmarkdown/rmd/latex/default.tex has a wrong spelling for:
\UseMicroTypeSet (it was \UseMicrotypeSet)
After correcting in the above file PDF generation was smooth.
While using RMarkdown in RStudio, with R-3.1.2, I found the following bug:
Symptom: would not generate a PDF document.
Error: the file rmarkdown/rmd/latex/default.tex has a wrong spelling for:
\UseMicroTypeSet (it was \UseMicrotypeSet)
After correcting in the above file PDF generation was smooth.