1Objectives¶
By the end of this lesson you will be able to:
Choose between installing R + RStudio locally and using the CSUB JupyterHub, based on your own device and needs.
Install R, RStudio, and the course packages on your own computer.
Access the CSUB JupyterHub and open a notebook with R already running.
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 required | Install two programs, once | None — a web browser is enough |
| Works offline | Yes | No — needs internet |
| Works on a shared/lab/library computer | Only if you can install software | Yes |
| Where your work is saved | Your own computer | The JupyterHub server (csub.jupyter.cal-icor.org) |
| Good for | Homework at home, projects, keeping R long-term | Labs, 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
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://
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:
Use the JupyterHub for labs (they are built for it), for a quick check on any device, or if your own computer can’t install software.
Use local RStudio for homework, projects, and any time you want R installed permanently and working offline.
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¶
R (the engine) and RStudio (the interface) are two separate installs; you need both for a local setup.
install.packages(c("mosaic", "BSDA")), run once in the RStudio console, adds this course’s entire toolkit.The CSUB JupyterHub (
csub.jupyter.cal-icor.org) needs no installation and comes with everything pre-installed — log in with your CSUB credentials and open a notebook with the R kernel.Labs typically run on the JupyterHub; homework and projects often run locally — use whichever fits the moment.