R Markdown and Reports
r
rmarkdown
markdown
rstudio
citations
latex
knitr
pandoc
publishing
Guides, citation tools, templates, and output packages for writing reproducible reports and papers with R Markdown and knitr.
This guide collects material for writing reports, papers, and slides that combine text and R code in R Markdown. Begin with the three picks under Start here, then use the sections on citations, templates, and output formats as your project needs them. PDF output needs a LaTeX installation; the TinyTeX page links to the easy setup, and the R page covers installing R.
Start here
- Posit Documentation on RMarkdown — First lesson of Posit’s R Markdown tutorial. RMarkdown uses Pandoc’s implementation of Markdown (see the Pandoc entry below).
- R Markdown: The Definitive Guide (2023) — Reference book covering R Markdown’s output formats, options, and features.
- R Markdown Cookbook (2024) — Task-based follow-up to the Definitive Guide, for more advanced work.
Learning R Markdown
- Pandoc’s Markdown — Section of the Pandoc manual describing the Markdown syntax that R Markdown documents are written in.
- RMarkdown for Scientists — Online book created for a three-hour workshop on R Markdown.
- Introduction to R Markdown (2019) — Introductory R Markdown tutorial published on RPubs in 2019.
- Writing reproducible reports in R with markdown, knitr and pandoc — Nice R Code guide from 2013 on assembling reproducible reports from these three tools (archived copy).
- Compiling Reports from R Scripts — Posit article on turning a plain R script into a report.
- Knitr’s best hidden gem: spin — Dean Attali’s post introducing knitr’s spin function for writing reports from R scripts (archived copy).
- Interchanging RMarkdown and “spinnable” R — R-Bloggers post on moving between R Markdown documents and plain R scripts with spin.
- rstudio/rmarkdown — Source code and issue tracker for the rmarkdown package.
Citations and bibliographies
- Bibliographies and Citations — Posit guide to adding bibliographies and citations to R Markdown documents.
- Citations in R Markdown — Tutorial on citing publications and building bibliographies with RStudio’s citation tools.
- RStudio: Quick Guide to Citations — Short YouTube guide to citations in RStudio.
- citr — RStudio addin for inserting Markdown citations.
- knitcitations — Package that generates citations for knitr Markdown and HTML documents.
- RefManageR — Package for importing and managing bibliographic references from R.
- grateful — Package that helps you cite the R packages used in an analysis.
Templates and output formats
- rddj-template — Template for starting a reproducible R Markdown project in data journalism.
- thesis_in_rmarkdown — Example project for writing a thesis in R Markdown.
- svm-r-markdown-templates — Collection of R Markdown templates for academic manuscripts, Beamer presentations, and syllabi.
- pagedown — Package for turning R Markdown HTML output into paged documents that print well.
- officer — Package for creating Word and PowerPoint documents from R.
- remedy — RStudio addins that simplify writing Markdown.
- tinytex — Small LaTeX distribution for R Markdown PDF output; the TinyTeX page links to its website.
- RPubs — Getting-started page for publishing R Markdown documents online with RPubs.