Installing R and RStudio

Overview

Before we can start working with the tidyverse, you’ll need R and RStudio installed on your own computer. R must be installed first — RStudio is an interface that runs on top of R, not a replacement for it.

Installation steps

1. Check your computer type

On Mac: Apple menu → About This Mac → check whether you have an Apple (M-series) chip or an Intel processor. This determines which R installer you need.

2. Download and install R first

Go to CRAN, choose your operating system, and download the base installer:

  • Windows: choose “base”
  • Mac: choose the installer matching the chip type found in Step 1

Run the installer with default settings. You won’t open R directly after this — it runs in the background for RStudio to use.

3. Download and install RStudio Desktop

Go to posit.co/download/rstudio-desktop. The page auto-detects your OS — download the free RStudio Desktop Open Source edition and run the installer with default settings.

4. Open RStudio and verify the setup

Launch RStudio (not R). You should see four panels. Click into the Console panel (bottom-left), type:

1 + 1

and press Enter. If it returns 2, R and RStudio are correctly linked.

5. Handle Mac security warnings if needed

If macOS blocks RStudio with “cannot be opened because the developer cannot be verified,” go to System Preferences → Privacy & Security and click “Open Anyway” next to the RStudio message.

Troubleshooting

  • RStudio won’t open / no console appears: R was likely not installed, or was installed after RStudio. Reinstall R, then relaunch RStudio.
  • “Developer cannot be verified” (Mac): System Preferences → Privacy & Security → “Open Anyway.”
  • Very old operating system: current RStudio may not install. Archived older RStudio versions are available on the Posit downloads page.
  • Package installation errors later in the course: usually resolved by updating to the newest version of R via CRAN.

If you’re still stuck, bring your laptop to office hours or book a slot through the Canvas appointment scheduler.