1Objectives¶
By the end of this lesson you will be able to:
Decide, for your own situation, whether to install R/RStudio or use CSUB JupyterHub.
Install R and RStudio Desktop on a Windows or Mac computer.
Open CSUB JupyterHub and start an R notebook without installing anything.
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).
| Situation | Recommendation |
|---|---|
| You want R on your own laptop, permanently, and don’t mind a ~20-minute one-time install | Install 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 now | Use CSUB JupyterHub |
| Your laptop is old, slow, or almost out of storage space | Use 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¶
Go to cran.r-project.org (CRAN — the official home of R).
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
.pkgfile matching your Mac (Apple silicon vs. Intel — if you’re not sure which chip your Mac has, choose thearm64build for anything from late 2020 onward, or check Apple menu ▸ About This Mac).
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¶
Go to posit
.co /download /rstudio -desktop (RStudio is made by a company called Posit). Download the free RStudio Desktop installer for your operating system.
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).
Go to https://
csub .jupyter .cal -icor .org/. That is CSUB’s JupyterHub for this course; mosaicandBSDAare already installed there for you. (Your instructor or the course Canvas page may also give you a link that pre-loads a specific lab.)Log in with your CSUB credentials (the same ones you use for Canvas/MyCSUB).
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.
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¶
Windows says it can’t run the installer / “protected your PC.” Click More info, then Run anyway — this is a standard Windows warning for any new installer, not a sign of a problem.
Mac says the app is from an “unidentified developer.” Right-click (or Control-click) the installer and choose Open, then confirm.
RStudio opens but the Console shows an error about R not being found. R didn’t finish installing, or RStudio was installed first. Reinstall R (Step 1), then reopen RStudio.
You’re not sure JupyterHub logged you in correctly. Log out and back in with your full CSUB email/username, the same one you use for Canvas.
A full table of error messages and fixes is in Lesson 12.
7Summary¶
You need R installed before RStudio, if installing locally: R first, then RStudio Desktop, both free from CRAN and Posit.
CSUB JupyterHub needs no installation at all — just a browser and a link from your instructor.
R.version.string(or the shortergetRversion()) is a one-line way to confirm R is alive and talking to you, in either setup.
8Check your understanding¶
Which install option makes more sense for your own situation, and why?
What is the correct order to install R and RStudio, and why does the order matter?
If a classmate’s
R.version.stringprints a different version number than yours, should you be worried? Why or why not?