Background

This course will cover basics of reproducible research using R. We will also make use of the R Studio IDE, git, GitHub, and Docker. The code used in the course will also rely on several R packages.

Prior to the start of the course, we ask that you do your best to have:

  • working version of R Studio installed
  • working version of R >4.0 installed (version is suggested, but not required)
  • R packages listed below installed
  • git installed and configured
  • a registered GitHub account
  • docker installed
  • a registered DockerHub account

This page contains some instructions that may be helpful on installing the required software and packages. The videos below were created for the DATA 550 course at Emory University RSPH and are reproduced here out of context of that course. Thus, there may be some irrelevant or nonsensical commentary related to other contents of that course. Nevertheless, we hope that these videos are useful for you in preparing for the short course.

Installing R, R Studio, and git

The videos below will walk you through installation of R and R Studio. If you already have a working version of R Studio, you can ignore these parts of the videos. However, do be sure to also install git.

There is no need to make sure your version of R matches what is installed in the videos. In general, any version of R after R 4.0 should be sufficient. If you are working in R version 3.X, then some of the code may not run for you (and it may be time to make the jump to version 4 anyway…).

Mac instructions

The following instructions pertain to installing software on a Mac. You can skip this section if you are a Windows user.

Installing R and R Studio

In this video, we describe:

  • how to install R and R Studio on a Mac
  • how to check which version of R should be installed based on the chip in your Mac

You will see that the videos are slightly dated. For example, Mac has now released an M2 + M3 chips (not just Intel + M1 chips as described in the video). Just be sure to select the right version of R to install based on the chip in your computer.

Installing git

In this video, we describe:

  • how to install homebrew on a Mac
  • how to install git via homebrew on a Mac

Configuring git

In this video, we describe:

  • how to configure basic settings in git

Installing bash

In this video, we describe:

  • how to install the most recent version of bash via homebrew
  • how to set your Terminal to use bash instead of zsh (the default in recent Mac OS’s)

This video is not strictly necessary. zsh and bash share many elements of syntax and more than likely you will be able to follow all materials in this course without using bash. I will also note that different Mac OS’s and different user set ups on Macs lead to different behavior of the default shell in Terminal so I cannot guarantee that these instructions will work for everyone. If you are determined to install bash, but are having difficult, you should be able to google alternative instructions.

More about homebrew

In this video, we describe:

  • what homebrew is in greater detail
  • where homebrew stores files on your Mac

This video is not strictly necessary to watch. Only needed if you are curious to learn more about homebrew and how it works.

Windows instructions

The following instructions pertain to installing software on Windows. You can skip this section if you are a Mac or Linux user.

Installing R, R studio, and git

In this video, we describe:

  • how to install R, R studio and git on a Windows machine
  • what to select for the various options available during git installation

Configuring git bash with R Studio

In this video, we describe:

  • how to configure R Studio to use git bash in the Terminal console

This video is important for following along with the command line lecture!

Register for a GitHub account

In the course, we will make use of GitHub to practice collaborating on code. If you do not have a GitHub account, please sign up for one. The service is free and should only require a couple minutes to complete sign up.

R packages

Several R packages are used in this course and ideally should be installed prior to the start of the class. The following code chunk can be used to install the necessary packages.

install.packages(c(
  "tidyverse", "devtools", "gtsummary", "here", "RSocrata", "forcats"
))

If you have any difficulties installing these packages, please reach out to us via Slack.

Installing Docker

Docker can be challenging to install depending on how your computer is configured. Please read through the installation instructions and attempt to install Docker prior to the start of the class. If you run into difficulties, please reach out to us on Slack. We will also be available during breaks on the first two days of the class to help trouble shoot.

Dockerhub account

In this course, we will make use of Docker Hub repositories, which are free to access but require an account. Please register for an account prior to the start of the course.