Getting set up

set up
Due date

January 7, 2026

Modified

January 7, 2026

Optional check in due on Wednesday January 7 (Week 1) at 11:59 PM

In this class, we’ll be using R and RStudio to code up our statistical analyses. Walk through these steps to make sure you have both programs on your computer and that everything is working properly. You need to make sure these tasks are completed before workshop on Friday.

Do these set up steps as soon as possible!

At minimum, you need to have read through and completed tasks 1-7 (modifications for Jupyter instance below). If you want to submit the optional check-in for An to verify that you’ve done things correctly, you can do task 8 and submit your screenshots on Canvas.

If you do not have R, RStudio, and Quarto installed and running, we cannot stop for you. Do this before class starts!

What if I’m using the virtual machine?

If you are using the virtual machine, then you only need to do the following tasks (skip the others):

  • Task 3. Open RStudio
  • Task 4. Change your settings
  • Task 6. Test out reading in a package
  • Task 7. Set up a folder for class materials
  • (optional) Task 8. Take a screenshot of your set up

See the resource on using the virtual machine for more details.

What version should I install? Do I need to update R/RStudio?

You should have at least R 4.2.2 (released November 2022) and RStudio 2023.12.1.

If you have downloaded R/RStudio previously but you don’t have updated versions, then you need to update! To do so, follow the instructions for installation in Task 1.

An will be using R version 4.5.2 and RStudio version 2025.09.2+418.

Task 1. Install R.

Go to cran.rstudio.com. Choose the correct download for your operating system!

Click on the screenshot to make it bigger!

Task 2. Install RStudio (and optionally Quarto)

Go to posit.co/download/rstudio-desktop. Click on the button under “2: Install RStudio”. It should automatically show the correct version for your operating system.

Installing Quarto

You only need to install Quarto if you are running RStudio version 2022.07.1 or earlier. If you are installing a later version of RStudio, you do not need to install Quarto.
Follow the instructions for installing Quarto here.

If you cannot install Quarto on your computer (because it doesn’t work with your operating system, etc.), that is fine - you just might have some differences between what we do in class and what you see on your own computer.

Task 3. Open RStudio

When we say we’re “using R” in the class, what we’re really using is RStudio, which is a graphical user interface (GUI) for R (the language). Basically, we’re never going to open up “R”, but we’ll always open up “RStudio”.

Open RStudio on your computer.

Task 4. Change your settings

You can change some settings to make your life easier when working in RStudio. The following steps are all done in the same menu. Go to Tools > Global Options.

Change your color scheme.

You don’t have to stick with the boring RStudio color scheme! Go to Appearance and select the color scheme you want.

Change your workspace save settings.

Forming good data science habits starts from the beginning. Changing your workspace save settings will allow you to start with a clean, blank slate every time you open RStudio.

Go to the General tab. Make sure that:

  • “Restore .Rdata into workspace at startup” is unchecked
  • “Save workspace to .RData on exit” is on “Never”
  • “Always save history (even when not saving .RData)” is unchecked
Some of these may already be checked! If so, great! Double check everything though!

Change your code editing settings.

Then, go to the Code tab. Under editing, make sure:

  • “Insert spaces for Tab” is checked
  • “Auto-detect code indentation” is checked
  • “Insert matching parens/quotes” is checked
  • “Use native pipe operator, |>” is checked
  • “Auto-indent code after paste” is checked
  • “Vertically align arguments in auto-indent” is checked
  • “Soft-wrap source files” is checked
  • “Continue comment when inserting new line” is checked
  • “Enable hyperlink highlighting in editor” is checked
  • “Enable code snippets” is checked

Change your display settings.

Then, go to Display (still under the Code tab). Make sure:

  • “Highlight selected word” is checked
  • “Show line numbers” is checked
  • “Show margin” is checked
  • “Blinking cursor” (if you want it) is checked
  • “Enable preview of named and hexadecimal colors” is checked
  • “Use rainbow parentheses” is checked

Change your Markdown settings.

Then, go to the R Markdown tab. Under basic, make sure the following is checked:

  • “Soft-wrap R Markdown files” is checked
  • “Show output preview in:” selection is “Viewer Pane”

Change your visual settings.

Under visual (still under the R Markdown tab), make sure:

  • “Use visual editor by default for new documents” is unchecked
  • “Show document outline by default” is checked

Hit Apply to save all your changes. Do not forget to hit apply!!!

Task 5. Test out installing a package

Packages are the best part of using R. We’ll talk more about what packages are in workshop, but for now try installing a package. Go to your Console (the bottom left pane in the RStudio window), and type (or copy paste) install.packages("tidyverse"). Hit Enter.

You should get a message that looks something like this:

Operating system differences

The database that holds all these packages will automatically detect which version you need based on your operating system. Don’t worry if your output message doesn’t look exactly the same as the one here - just as long as you get something like “The downloaded binary packages are in…”, you’ve probably got the package installed.

Task 6. Test out reading in a package

Now you’ve installed a package, but you want to make sure you can actually run it. Again in the Console (the bottom left pane), type library(tidyverse) and hit Enter.

You should get a message that looks something like this:

Task 7. Set up a folder for class materials

Using R/RStudio requires you to know how your computer is organized and where your files are. For now, we’ll want to set up a folder in your computer called ENVS-193DS (note no spaces in the folder name).

All operating systems are different, but make sure that your folder is not in the “iCloud” or “Google Drive” folders in your computer. Basically, you want to be sure that you can get from your “root” directory (i.e. your actual computer hard drive) to the folder you’re using.

You can check this using the file path, or the folders you would need to open to get to the folder called ENVS-193DS. One example for MacOS is below, where the file path is written out at the bottom of the pane:

Jupyter instance steps

If you’re using the Jupyter instance, follow the directions in the “using the virtual machine” resource.

Task 8. Take a screenshot of your set up.

Take a screenshot of your RStudio window with the code for install.packages("tidyverse") and library(tidyverse) in your Console and submit it to the portal on Canvas. Your screenshot should look something like this:

Double check your screenshot!

Take a screenshot of your whole RStudio window. Make sure that the messages in the orange box (above) are visible in your screenshot! Otherwise we will not be able to troubleshoot whatever issues you are having with installation (if you are actually having any).

Then, take a screenshot of your ‘ENVS-193DS’ folder set up. It should be evident what the file path is, either from a path at the bottom of the window or on the side. It doesn’t matter where the file path is, just as long as you can tell where the folder is. Your screenshot should look something like this:

Making sure your file path is displayed

The easiest way to know where a file or folder is on your computer is to show the file path.

If you are using Mac OS, see these directions under “Show the path to a file or folder” to display the file path in the Finder window.

If you are using Windows 10 or 11, see this video with directions to show the file path in File Explorer.

Upload both screenshots to Canvas for your optional check-in.