Setup and Workflow

Stat 431


Your workflow refers to the series of good habits you get into in your coding process, that help save you time and headache down the road.

This document outlines our suggestions for getting going with your workflow. None of these items is required for the course; they will simply make your life easier down the road.

Updating R

Check your version of R. (This shows up in the console when you first open R or RStudio.) Ideally, it should be 3.6.0 or later. If this is the case, you are golden.

The easiest way to update R is to simply redownload it and then close and re-open RStudio.

Troubleshooting for Macs

First, identify which version of OSx you are running. How-to

Next, find out which version of R your computer can run. Link

If this version is 3.5 or later, download the latest version that your computer can handle.

If this version is 3.4 or earlier, you’re going to run in to some trouble. I recommend updating your version of OSx, if you are willing. If you can’t, then you can use rstudio.cloud to run R and RStudio on a free server. However, I recommend strongly against this option; your files will not be saved indefinitely, your computing power will be limited, and you will need an internet connection at all times to do your work.

Updating RStudio

RStudio can be downloaded here

You do not need an update if your RStudio logo looks like this:

You do need an update if your RStudio logo looks like this:

Installing/updating the tidyverse

In this class, we will make heavy use of the tidyverse packages.

If you have not used the tidyverse before, type the following into your console:

If you have used the tidyverse before, you only need to update packages. Type the following into your console:

Then follow the instructions that print out to update a few of your tidyverse packages.

Configure your options

There are a few settings we recommend that you change right away in RStudio.

First, you should not save your environment when you close RStudio:

Second, make a deliberate choice about where your chunks will evaluate when you run that. That is, if you reference files, are you referencing them relative to your Project, or relative to your R Markdown Document (which might live in a subfolder or even outside the project).

Project-based workflow

We strongly recommend that you adopt a project-oriented approach to your R work. That is, you should never open R or RStudio directly; you should only open the project you intend to work on.

This resource provides an excellent explanation of why and how to use projects.

Using GitHub

This course will require some basic use of GitHub. You may find that you want to incorporate it more deeply into your R experience.

This resource can help you integrate R and GitHub more fully, if you so choose.