Project Setup

The goal of this section is to help you:

  • Set up a directory on your computer to store scripts and data for this workshop
  • Back up all workshop materials online using Github

Prerequisites for Git workflow

  • You have a Github account. If not, create one here.
  • You have Git on your computer. Check by typing
git --version

in the Terminal pane in RStudio. Macs should already have Git, Windows will need to install Git Bash on their computer. - You have configured Git. Check by typing

git config --list

in the Terminal pane in RStudio. If you have not configured git, follow these instructions.

Workflow with Git

Make sure you have the prerequisites for this workflow (see above section), otherwise you’ll be frustrated.

  1. Go to github.com and create a new repository. Choose to make it public or private (your choice). Initialize with a README.
  2. Open RStudio. Click “New Project”. Click “Version Control”. Paste the URL of the repository you just created.
  3. Create the following folders in your project by clicking on “New Folder” in the Files pane in RStudio:
  • data
  • doc
  • R

Put data in data, written output in doc, and R code scripts in R.

  1. Once you’ve put data and scripts in, you can back up your documents by going to the tab in RStudio called “Git”.
  • Check the checkbox next to the items you’d like to back up.
  • Click “Commit”. Type an informative message, i.e. “Added materials from first workshop”.
  • Click “Push”. You have now uploaded your files to Github. If you go to the web link of the repository you created on Github, your materials should now be there.

Workflow without Git

  1. Open RStudio. Click “New Project”. Click “New Directory”.
  2. Create the following folders in your project by clicking on “New Folder” in the Files pane in RStudio:
  • data
  • doc
  • R

Put data in data, written output in doc, and R code scripts in R.

Additional reading