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.
Contents
The workshop is divided into ten parts. Most parts include exercises — 40+ in total.
Slides
The slides for the workshop are available to view at https://resulumit.com/teaching/rmd_workshop.html. 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.
Materials
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
- includes unformatted text from
- an R Markdown document to work on during the workshop
-
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
- this is how participants'
- an R Markdown file with all exercises are completed
-
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
References
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.