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. Choose between installing R + RStudio locally and using the CSUB JupyterHub, based on your own device and needs.

  2. Install R, RStudio, and the course packages on your own computer.

  3. Access the CSUB JupyterHub and open a notebook with R already running.

  4. Compare the two options and know when to use each.

2Two ways to run R for this course

You do not have to choose only one. Most students end up using both at different points in the semester.

Install locally (R + RStudio)CSUB JupyterHub
Setup requiredInstall two programs, onceNone — a web browser is enough
Works offlineYesNo — needs internet
Works on a shared/lab/library computerOnly if you can install softwareYes
Where your work is savedYour own computerThe JupyterHub server (csub.jupyter.cal-icor.org)
Good forHomework at home, projects, keeping R long-termLabs, quick checks, any device without admin rights
Course packages (mosaic, BSDA)You install once (below)Pre-installed by the department

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

R and RStudio are two separate, both free, downloads. R is the language and engine that actually runs your code; RStudio is an application (an “IDE,” integrated development environment) that makes working in R much more comfortable — it adds a code editor, a place to see your data and plots, and menus for common tasks. You need both; RStudio does nothing without R installed underneath it.

Step 1 — Install R. Go to the Comprehensive R Archive Network (CRAN) at cran.r-project.org and choose the installer for your operating system (Windows, macOS, or Linux). Run the installer with the default options. This course is built and tested on R 4.5.2 — any recent 4.x release will work, but if you can choose, prefer the newest stable release CRAN offers.

Step 2 — Install RStudio Desktop. Go to posit.co/download/rstudio-desktop and download the free RStudio Desktop edition for your operating system. Run the installer with the default options. RStudio will automatically find the R installation from Step 1 — you do not need to point it anywhere.

Step 3 — Open RStudio and install the course packages. Open RStudio (not R by itself). In the Console pane (usually bottom-left), type the following and press Enter:

install.packages(c("mosaic", "BSDA"))

This single line downloads and installs both course packages — mosaic (with its ggformula plotting layer, plus dplyr and other helpers it pulls in automatically) and BSDA — from CRAN. It can take a minute or two the first time; you’ll see download and compilation messages scroll by, and it’s done when you get your prompt (>) back with no red Error text. You only need to run install.packages() once per computer — after that, L05 shows you the much shorter library() line you run at the start of every session.

4Option B — The CSUB JupyterHub (nothing to install)

CSUB provides a hosted, browser-based platform — JupyterHub — where R, mosaic, BSDA, and every other package this course needs are already installed for you. You open a web browser, log in, and start writing R immediately.

Step 1 — Go to the JupyterHub URL. Open https://csub.jupyter.cal-icor.org/ in your browser. (Your instructor may also give you a link that pre-loads that week’s lab materials.)

Step 2 — Log in with your CSUB credentials. Use the same NetID/username and password you use for MyCSUB and Canvas.

Step 3 — Open a notebook and pick the R kernel. A notebook (file extension .ipynb) mixes explanatory text with runnable R code cells — this is the format the Jupyter labs use. When you open a new notebook or one provided for a lab, make sure its kernel (the engine running your code, shown in the top-right of the notebook) says R, not Python. Lab notebooks are already set up this way; you’d only need to check this if you create a new notebook yourself.

Step 4 — Run a cell. Click into a code cell and press Shift+Enter to run it and move to the next cell — this is the notebook equivalent of pressing Enter in an RStudio console. L03 covers notebooks in depth.

5Which one should you use?

There is no wrong choice — many students switch between them:

Either way, the R code you write is identical — mosaic and BSDA behave the same whether you’re in RStudio or a JupyterHub notebook. L03 walks through the actual working environment (panes, cells, projects) for both.

6Summary