This site is a gallery for R Markdown templates/themes. Currently, 131 templates/themes are collected, including 22 packages classified in 12 groups. You could view the R Markdown templates by groups, see the live demos, and share your new discoveries. This is still far from a complete collection of R Markdown, thus your recommendations would be appreciated. Feel free to send me an email or contribute to the repo of this site (see the section How to contribute).

R Markdown is a fantastic toolbox in the R community. With R Markdown, you can produce a variety of reproducible documents for communication, including reports, scientific manuscripts, journal articles, theses, books, posters, slides, websites, etc., even if you do not know how to use R itself. They are platform-independent. This ecosystem is still growing fast. R Markdown is a demonstration that shows how much amazing work R can do besides data processing and visualization.

The R Markdown world is huge. After years of using R Markdown, I collected many nice packages, templates, and themes. I found it, however, painful to search a suitable template/theme before I started writing something. Sometimes it was like searching the ocean for a needle. I knew it was somewhere, but I had no idea where it was.

The other day @Cloud2016 shared another nice beamer template. I raised the question again, “how do you guys organize your collection of templates?” Later an idea came into my mind: why not build a website?

That is basically why you see this site.

Note that the R blogdown package is not displayed on this website, as the Hugo theme gallery is already available.

There are five buttons at the sidebar.

  • Class: Group the R Markdown templates/themes by document type.
  • Packages: Group the R Markdown templates/themes by R packages.
  • Gallery: Display the thumbnails of all. Caution! It takes time to load all.
  • About: Show how to use this site.
  • Contact: Send me an email if you would like to share something.

On the template page, you can find the thumbnail, the package name, the author, the link to the project webpage, and the link to the demonstration (if any).

How to use

  1. You have to install R and the R package which contains the template of interest.
    • For installing R, see CRAN.
    • For installing the R package, run install.packages("package_name") if it is on CRAN. Otherwise, check the project webpage for help.
    • For creating pdf documents, the R package tinytex is recommended. After installing tinytex, run tinytex::install_tinytex() for installing a smart distribution of LaTeX.
  2. The installation of RStudio IDE is not a must, but recommended. The subsequent steps are described on the basis of RStudio IDE. If you don’t use it, please visit the package webpage for help.
  3. Open RStudio IDE, click the “New File” button and choose “R Markdown”. In the “From Template” tab, choose the template you want.

Step 1

Step 2

  1. Once inside your new .Rmd file, you should see some boilerplate text that includes code chunks. Use the “Knit” button in the RStudio IDE to render the file and preview the output with a single click or use the keyboard shortcut Cmd/Ctrl + Shift + K.
  2. Once a demonstration document is successfully created, you can delete all the text below the YAML frontmatter and fill in your own .Rmd by:
    • Adding code chunks (keyboard shortcut: Ctrl + Alt + I; OS X: Cmd + Option + I),
    • Writing prose with Markdown formatting.

For more help getting started in R Markdown, please see the R Markdown website, or read the section Learning materials.

How to contribute

If you would like to share an R Markdown template/theme, simply follow this procedure:

  1. Go to the GitHub repo of this site, and navigate to “content/portfolio/".
  2. Create a new post in markdown. You could open an existing post such as “xjtlu_poster.md", copy everything and paste to your new post, commit the change, and push.

Learning materials