Reference & Resources
Lesson index
- 1. Set Up Your Machine for This Course (Week 01 · Thu Sep 24)
- 2. R Basics (Week 01 · Tue Sep 29)
- 3. Seeking Help (Week 02 · Thu Oct 1)
- 4. Data Structures (Week 02 · Thu Oct 1)
- 5. Exploring Data Frames (Week 02 · Tue Oct 6)
- 6. Control Flow (Week 03 · Thu Oct 8)
- 7. Cleaning Data in Practice: Subsetting (Week 03 · Tue Oct 13)
- 8. Graphics with ggplot2 (Week 04 · Thu Oct 15)
- 9. Vectorization (Week 04 · Tue Oct 20)
- 10. Functions Explained (Week 05 · Thu Oct 22)
- 11. Regression in Practice (Week 05 · Tue Oct 27)
- 12. Writing Data (Week 06 · Thu Oct 29)
- 13. dplyr I: filter, select, mutate (Week 06 · Tue Nov 3)
- 14. dplyr II: groups and joins (Week 07 · Thu Nov 5)
- 15. Reshaping Data with tidyr (Week 07 · Tue Nov 10)
- 16. Reports with Quarto (Week 08 · Thu Nov 12 · Tue Nov 17)
- 17. Writing Good Software (Week 09 · Thu Nov 19 · Tue Nov 24)
Setting up R, Positron and Quarto
The exercises on this site run in your browser via webR, so you can practise anywhere. For the course you also need R and Positron on your own computer. Lesson 1 walks through it step by step:
- R (4.3 or newer): cloud.r-project.org.
On a Mac, pick the installer for your chip (Apple silicon
arm64or Intelx86_64). - Positron: positron.posit.co. Open your course folder with File → Open Folder; no project file is needed.
- Quarto comes bundled with Positron. You only need a separate install from
quarto.org to render from a
plain terminal. For PDF output, run
quarto install tinytexonce. - Packages, once, in the R console:
install.packages(c("ggplot2", "dplyr", "tidyr", "readr", "quarto")).
Setup guidance adapted from the Software Carpentry r-novice-gapminder setup instructions (CC BY 4.0), updated for Positron and Quarto.
Glossary
| Term | Definition |
|---|---|
| Assignment | Storing a value in a named object, using <- (e.g. x <- 5). |
| Vector | The most basic R data structure: an ordered collection of values all of the same type. |
| Data frame | A table-like structure where columns can hold different types, used for most tabular data (like the gapminder dataset). |
| Factor | R's data type for categorical variables with a fixed set of possible values ('levels'). |
| Function | A reusable, named block of code that takes inputs (arguments) and returns a value. |
| Argument | A value passed into a function, either by position or by name (e.g. round(3.14159, digits = 2)). |
| Subsetting | Extracting part of a data structure using [, [[, or $. |
| Logical indexing | Subsetting using a vector of TRUE/FALSE values, one per element/row. |
| Package | A bundle of R functions, data, and documentation that extends base R (installed with install.packages()). |
| Pipe | The %>% (magrittr) or |> (base R) operator, which passes the result on its left into the function on its right. |
| Tidy data | A data layout where each variable is a column, each observation is a row, and each type of observational unit is a table. |
| Quarto document | A .qmd file mixing a YAML header, Markdown prose and executable code cells, rendered into HTML, PDF or Word reports. |
| Working directory | The folder R uses as the starting point for relative paths; in Positron, the folder you opened. |
| Linear model | A straight-line fit of a response on a predictor, made with lm(y ~ x, data = df). |
Further reading
- R for Data Science (Wickham, Çetinkaya-Rundel & Grolemund) — free online book.
- Official R manuals on CRAN.
- Original Software Carpentry reference page, which this page draws on.