Reference & Resources

Lesson index

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:

Setup guidance adapted from the Software Carpentry r-novice-gapminder setup instructions (CC BY 4.0), updated for Positron and Quarto.

Glossary

TermDefinition
AssignmentStoring a value in a named object, using <- (e.g. x <- 5).
VectorThe most basic R data structure: an ordered collection of values all of the same type.
Data frameA table-like structure where columns can hold different types, used for most tabular data (like the gapminder dataset).
FactorR's data type for categorical variables with a fixed set of possible values ('levels').
FunctionA reusable, named block of code that takes inputs (arguments) and returns a value.
ArgumentA value passed into a function, either by position or by name (e.g. round(3.14159, digits = 2)).
SubsettingExtracting part of a data structure using [, [[, or $.
Logical indexingSubsetting using a vector of TRUE/FALSE values, one per element/row.
PackageA bundle of R functions, data, and documentation that extends base R (installed with install.packages()).
PipeThe %>% (magrittr) or |> (base R) operator, which passes the result on its left into the function on its right.
Tidy dataA data layout where each variable is a column, each observation is a row, and each type of observational unit is a table.
Quarto documentA .qmd file mixing a YAML header, Markdown prose and executable code cells, rendered into HTML, PDF or Word reports.
Working directoryThe folder R uses as the starting point for relative paths; in Positron, the folder you opened.
Linear modelA straight-line fit of a response on a predictor, made with lm(y ~ x, data = df).

Further reading