Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1Objectives

By the end of this lesson you will be able to:

  1. Decide, for your own situation, whether to install R/RStudio or use CSUB JupyterHub.

  2. Install R and RStudio Desktop on a Windows or Mac computer.

  3. Open CSUB JupyterHub and start an R notebook without installing anything.

  4. Confirm that your setup is actually working.

2Two ways to get R — pick one

You do not need both. Pick whichever fits you; you can always switch later, since the R underneath is identical either way (Lesson 1).

SituationRecommendation
You want R on your own laptop, permanently, and don’t mind a ~20-minute one-time installInstall R + RStudio Desktop (below)
You’re on a shared, locked-down, or low-storage computer (e.g., a campus lab machine, a Chromebook)Use CSUB JupyterHub — nothing to install
You just want to try one example from this book right nowUse CSUB JupyterHub
Your laptop is old, slow, or almost out of storage spaceUse CSUB JupyterHub — all the computing happens on CSUB’s server

3Option A — Install R and RStudio on your own computer

You need two separate downloads, installed in this order: R first, then RStudio. RStudio is just the friendly window (Lesson 1); it needs R already present to have an engine to run.

3.1Step 1 — Install R

  1. Go to cran.r-project.org (CRAN — the official home of R).

  2. Click the download link for your operating system:

    • Windows: “Download R for Windows” → “base” → the big Download R link.

    • Mac: “Download R for macOS” → the .pkg file matching your Mac (Apple silicon vs. Intel — if you’re not sure which chip your Mac has, choose the arm64 build for anything from late 2020 onward, or check Apple menu ▸ About This Mac).

  3. Open the downloaded file and click through the installer with the default options — you don’t need to change anything.

3.2Step 2 — Install RStudio Desktop

  1. Go to posit.co/download/rstudio-desktop (RStudio is made by a company called Posit).

  2. Download the free RStudio Desktop installer for your operating system.

  3. Run the installer with the default options.

3.3Step 3 — Open RStudio and confirm it worked

Open RStudio (not R by itself — you’ll always open RStudio, and it starts R for you automatically). You’ll see a window divided into a few panes; Lesson 3 tours them properly. For now, click inside the pane titled Console (it should already be active) and type this, then press Enter:

R.version.string
[1] "R version 4.5.2 (2025-10-31 ucrt)"

Your version number and date will likely differ from the one shown above (new R versions come out a few times a year) — that’s completely fine. What matters is that you see some version string print back, which means R is installed and RStudio can talk to it.

4Option B — Use the CSUB JupyterHub (no installation)

CSUB provides a shared JupyterHub server where R already has the whole course toolkit (Lesson 5) pre-installed — you log in through a browser and get a notebook, a document that mixes your own notes with runnable R code (more on notebooks in Lesson 3).

  1. Go to https://csub.jupyter.cal-icor.org/. That is CSUB’s JupyterHub for this course; mosaic and BSDA are already installed there for you. (Your instructor or the course Canvas page may also give you a link that pre-loads a specific lab.)

  2. Log in with your CSUB credentials (the same ones you use for Canvas/MyCSUB).

  3. You’ll land on a file browser. Your instructor will tell you whether to open a notebook they’ve already shared with you, or to create a new one: New ▸ Notebook ▸ R.

  4. In the first gray box (a cell), type a line of R and run it with Shift + Enter (this runs the cell and moves you to the next one).

There is nothing to install, nothing to update, and your work is saved on CSUB’s server — handy if you switch between the campus computer lab and your own laptop.

5Which one should you actually use?

If you’re not sure, start with CSUB JupyterHub — it has zero setup, so you can be running R in the next five minutes and worry about installing anything later (or never, if JupyterHub works fine for you all semester).

6Troubleshooting a stuck install

A full table of error messages and fixes is in Lesson 12.

7Summary

8Check your understanding

  1. Which install option makes more sense for your own situation, and why?

  2. What is the correct order to install R and RStudio, and why does the order matter?

  3. If a classmate’s R.version.string prints a different version number than yours, should you be worried? Why or why not?