Tools for reproducible research

Pre-class activity for today:

  1. Install R and RStudio, following Steps 1 and 2 from this website.

  2. Install Git onto your computer.

  1. If you already have R, RStudio, and Git already available on your computer, verify that you have the most recent versions of each. This is especially important for R, as it is updated regularly (approximately each month). Currently, Gaurav is using R version 4.5.1 (2025-06-13 ucrt).a

  2. Create an account on GitLab, which is the remote git server that we will use for this course.

  3. Follow the steps in this video to authenticate your laptop’s credentials with Gitlab.

  4. Share your gitlab username with Gaurav through email or Discord so that you can be added to the course “group”.

  5. Within R, execute the following code to install useful packages:

install.packages('rmarkdown')
install.packages('knitr')
install.packages('tidyverse')
install.packages('tinytex')
install.packages('vegan')

Reading discussion

Reading discussion

Reading discussion

Direct link: https://opensciency.github.io/sprint-content/ethos-of-open/lesson1-intro-to-open-science.html

Reading discussion

Direct link: https://www.youtube.com/watch?v=Op9l8PwCTfY&t=1793s

Tools overview:

  • R and RStudio

  • Git, Gitbash, and Gitlab

In this course, plan to write R (or python) code in RStudio, and complete your submissions through Gitlab.

  • Today, we will go through the steps for achieving this general workflow.

  1. Initiate a new repository (“New Project”) on GitLab
  • Create Blank Project
    • Give a name like “reprores-class-notes”
  1. Create a new project in R by cloning this repository.
  • File –> “New Project”
  • “Version Control” –> Git –> Enter URL
  • Save at an appropriate location on your file system
  1. Create a new file, which can be committed and pushed to gitlab.
  1. Create a new Quarto file; render it as a PDF; commit and push it to gitlab.

Example: Cloning an existing repository

Let’s attempt to recreate the results from one of Gaurav’s first papers.

https://onlinelibrary.wiley.com/doi/full/10.1111/ele.13280

Semester project: Recreating a key result from your field