Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Writing Reproducible Research Papers with R Markdown

This repository holds the materials for a workshop on writing reproducible research papers with R Markdown, first taught at Campus Luzern in March 2020.

Unless otherwise noted, all material is copyright Resul Umit, licensed CC-BY-SA 3.0. An easy to read summary of this permissive licence is available on the Creative Commons website.


The workshop is divided into ten parts. Most parts include exercises — 40+ in total.

Part 1. Getting the Tools Ready
- e.g., downloading course material
Part 6. Adding Code, Figures, and Tables
- e.g., plotting data
Part 2. Introducing R Markdown
- e.g., creating a new document
Part 7. Addressing Functionality Gaps
- e.g., adjusting line spacing
Part 3. Setting Metadata
- e.g., defining output format
Part 8. Using Version Control
- e.g., integrating Git and GitHub
Part 4. Writing Text
- e.g., adding emphasis to text
Part 9. Collaborating with Others
- e.g., working simultaneously with co-authors
Part 5. Managing References
- e.g., citing sources
Part 10. Working on a Real Project
- e.g., converting a work-in-progress of yours


The slides for the workshop are available to view at These HTML slides are created with xaringan package (Xie, 2020).

See the presentation directory for the source files underlying the slides. The same directory also includes the PDF version of the slides, which might come handly if the HTML version is too large for your browser to function --- as it is for some Safari users.


The remaining materials are available in a separate branch of this repository, called materials. It includes the following:

  • manuscript\reproduce_this.pdf

    • a document, formatted in Word but saved as PDF, to be re-created with R Markdown
    • random sentences in the document are generated with the stringi package (Gagolewski, 2020)
    • figures and tables are based on a fabricated dataset (journals.csv, see below)
    • key sections in-need of attention are highlighted
  • manuscript\journals.Rmd

    • an R Markdown document to work on during the workshop
      • includes unformatted text from reproduce_this.pdf to save time
      • major components, such as paragraphs and tables, are numbered and marked in comments to facilitate navigation
  • manuscript\solutions.Rmd

    • an R Markdown file with all exercises are completed
      • this is how participants' journals.Rmd file should look at the end of the workshop
  • manuscript\references.bib

    • a BibTeX document with three fabricated references
  • manuscript\apa_7th.csl

    • a Citation Style Language document, with APA (7th Edition) referencing style (Wiernik, 2020)
  • data\journals.csv

    • a dataset created with the fabricatr package (Blair et al., 2019), imagined to explore the Google Scholar rankings of fictitious journals

    • includes the following variables

      • name: journals (1090 random titles)
      • origin: geographic origins (five continents)
      • branch: major discipline of journals (four branches)
      • since: time of first publication (years)
      • h5_index: H5 Index (integers)
      • h5_median: H5 Median (integers)
      • english: English (1) vs. other-language (0) journals
      • subfield: subfield (1) vs. generalist (0) journals
      • issues: number of issues published per year (integers)
  • image\google_scholar.png

    • a screeenshot image of the Google Scholar homapage, copyright Google, LLC


Blair, G., Cooper, J., Coppock, A., Humphreys, M., Rudkin, A. and Fultz, N. (2019). fabricatr: Imagine your data before you collect it. R package, version 0.10.0.

Gagolewski, M. (2020). stringi: Character String Processing Facilities. R package, version 1.4.6.

Wiernik, B. M. (2020). American Psychological Association 7th edition (no ampersand). Citation style language file, version 1.0.

Xie, Y. (2020). xaringan: Presentation Ninja. R package, version 0.18.


Materials for a workshop on writing reproducible research papers with R Markdown








No releases published


No packages published

Contributors 4