Skip to main content
← All weeks

Optional guide · not part of the lesson sequence

Install R on your computer

You don’t need this to finish the course: every lesson has a built-in R workspace. Install R if you want to keep working on your own computer, which you’ll likely want for bigger projects.

1. Install R (the engine)

  • Go to cran.r-project.org.
  • Choose Download R for Windows (then 'base') or Download R for macOS (pick the Apple silicon build for M1/M2/M3 Macs, Intel otherwise).
  • Open the downloaded file and accept the default options.

2. Install RStudio (the workspace)

  • Go to posit.co/download/rstudio-desktop.
  • Download the free RStudio Desktop for your computer.
  • Install it with the default options. Always open RStudio, not R itself.

3. Check it works

  • Open RStudio. Find the Console panel (bottom left).
  • Type 312 + 287 and press Enter. You should see [1] 599.

4. Load Luz’s data

  • Download the sales file below and save it in a folder for this course.
  • In RStudio choose Session → Set Working Directory → Choose Directory, and pick that folder.
  • Run: truck <- read.csv("taco-truck-sales.csv") then head(truck).

Stuck?

  • On a school or Chromebook computer you may not be able to install software. Use the R workspace built into each lesson, or a free posit.cloud account.
  • If an install fails, restart your computer and try again before asking your instructor.
Download taco-truck-sales.csv