Code Publishing Tutorial
This tutorial covers how to make your code available to others. It wraps up a series of tutorials which we recommend to go through in advance:
- Introduction to version control with git and GitHub within RStudio: This tutorial explains how to set up a simple project with version control.
- Collaborative coding with GitHub and RStudio: Here you can learn how to collaborate with others on code projects using GitHub.
- Introduction to R: This is an introduction to the R programming language.
- Introduction to
renv
: Here you can learn how to manage the dependencies of an R project. - Introduction to Quarto: Learn how to combine prose and code to make documents more reproducible.
- Introduction to Zotero: Get introduced to the reference management software Zotero.
- FAIR research data management: Learn how to make your data findable, accessible, interoperable, and reusable.
While the general principles taught in this tutorial apply to most researchers publishing code, we will focus on the programming language R and the publishing system Quarto.
To follow the tutorial you need to have installed Git, R, and Quarto. Windows users may additionally need RTools. Some things will be explained using the RStudio IDE, but you are free to use any IDE you like.
Quarto is a tool to render dynamic documents, but not the only one.
It is the successor of the R package rmarkdown
and mostly backwards-compatible. rmarkdown
continues to be supported, but the development of new features happens in Quarto. The main difference is that Quarto has first-class support for Python. In other words, Python users of Quarto do not need to have R installed.
While this tutorial focuses on Quarto, you can also create reproducible research projects with the following tools:
We will start with creating a simple report which incorporates R code. Then, we will focus on what is required to publish your work:
- removing legal barriers: adding an appropriate license
- high-level documentation: creating a README file
- archival: uploading it to a repository