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. Explain, in your own words, what R is.

  2. Explain the difference between R, RStudio, and JupyterHub.

  3. Explain why MATH 1209 shows you R at all, given that you can pass the course with a calculator.

  4. Type one line of R and read the answer it prints back.

2The idea, in plain words

R is a free program that does math and works with data. That’s it — that’s the whole idea. You type an instruction (“add these numbers,” “find the average,” “draw a graph of this”), press a key, and R does it and shows you the result. People also call R a programming language, which sounds intimidating, but a language is just a set of words and grammar rules for telling R what to do — and you’ll only need a small vocabulary for this course.

R was built by and for statisticians, so unlike a general-purpose programming language, it already knows how to compute a mean, run a hypothesis test, or draw a histogram — those aren’t things you’ll build from scratch, they’re single commands you’ll learn to call.

3R, RStudio, and JupyterHub — three names, one engine

This trips up almost everyone at first, so let’s separate the three words you’ll see this semester.

TermWhat it actually isAnalogy
RThe engine that does the calculations. You never see R by itself — it runs invisibly underneath the other two.The engine under the hood of a car
RStudioA free program that gives R a friendly window: a place to write code, see results, view graphs, and browse your files, all at once. You install this on your own computer.The car’s dashboard, seats, and steering wheel
CSUB JupyterHubA website your instructor gives you a link to. It also gives R a friendly window — a notebook in your browser — except R is running on a CSUB server, not your laptop, so there is nothing to install.Renting the same car instead of buying one

Whichever one you use, the R underneath is identical — the same commands, the same answers. Lesson 2 walks you through setting up either option, and Lesson 3 shows you what actually running code looks like in each.

4Why does a calculator-first course even mention R?

Look back at how this course works: every method is taught idea → formula → calculator steps → “see it in R.” R is there for three honest reasons:

5Your first line of R

Whatever tool you end up using (Lesson 2), you’ll always be looking at the same basic idea: you type something, and R answers back on the next line, starting with [1]. Here’s a real example — this is the exact code that was run, and the exact answer R printed:

2 + 2
[1] 4

The [1] just means “this is the first value in the answer” — you’ll mostly ignore it for now. A few more, so the pattern sinks in:

10 * 4 - 3
[1] 37
mean(c(90, 85, 95))
[1] 90

That last one introduces two things you’ll meet properly in Lesson 4: c(90, 85, 95) bundles three numbers into a list R can work with (a vector), and mean(...) is a function — a built-in verb that does something to whatever you put inside its parentheses. Here it found the average of three exam scores.

R can also work with text, not just numbers:

"Hello, R!"
[1] "Hello, R!"

Notice the quotation marks stayed in the answer — that’s R’s way of showing you “this is text, not a number.” You’ll see this distinction again in Lesson 4.

6A map of the rest of this book

7Summary

8Check your understanding

  1. In your own words, what is the difference between R and RStudio?

  2. Why does this book say you can succeed in MATH 1209 without ever opening R?

  3. What do you predict 5 * 5 - 5 will print? (You’ll be able to check this for real once you finish Lesson 2.)