For Python users (and total beginners)

Set up R

New to R? Two minutes to install it and read a CSV. That's all you need before the chapters — they teach the actual statistics.

download

1 · Install R and RStudio

Install R (the language) from cran.r-project.org, then RStudio Desktop (the friendly editor) from posit.co. Open RStudio — you'll type code into the Console at the bottom.

folder_open

2 · Find your file

Download the challenge CSV and note where it lives. The simplest path: put the CSV in a folder, then point R at that folder once.

R
# tell R which folder to work in (use your own path) setwd("C:/Users/you/Downloads") # …or in RStudio: Session ▸ Set Working Directory ▸ Choose Directory
table_view

3 · Read the CSV

R
> d <- read.csv("lakers_celtics.csv") # load it into a data frame > head(d) # first few rows > summary(d) # min/mean/max of every column > d$points # one column, by name (use $)

A data frame is just a table — like a pandas DataFrame.

terminal

4 · The handful of basics

R
# print and combine print(mean(d$points)) cat("average points:", mean(d$points), "\n") # a simple loop for (g in 1:3) { cat("game", g, "scored", d$points[g], "\n") }

Loops, cat() and print() are always allowed in the challenge — it's only the statistical functions that your chapters unlock.

That's the setup — now the fun part

The chapters teach the statistics (and the one function you'll actually model with).

Start Chapter 1 arrow_forward SLR in R