R for behavioural & psychological science · from zero

Never opened R, to an analysis a reviewer cannot fault.

Twelve volumes and 102 days of forty-five minutes. Every line of code is copyable with its real output printed underneath, so nothing depends on your machine working first. The course is built backwards from what a PhD committee actually checks: that you chose the right model, that you can say why, and that someone else can rerun you.

Start day 1 → Open the live console How a day works Which model do I need?
{{ totalDays }}
study days of 45–60 minutes
{{ totalFns }}
functions indexed and explained
{{ totalPkgs }}
packages, each with a reason
8
portfolio artefacts you finish holding
{{ donePercent }}
of the course ticked off

The twelve volumes

Volumes one to three are craft; four to eight are the statistics your research actually runs on; nine turns the work into evidence. Each keeps its own progress in this browser.

{{ v.badge }} {{ v.title }} {{ v.blurb }} {{ v.progressLabel }}

How a day works

Every volume is the same shape, so once you have done day 1 you know the whole course. Forty-five minutes, one sitting, in this order.

01
Read the paragraph before the code
It says what decision the code makes and why, in plain language. Skipping it is how people end up with commands they cannot defend in a viva.
02
Every code block already shows its answer
The grey half is R's real printed output. Read it before you run anything — so when your own run differs, you know it is you and not the lesson. Copy in the corner takes the code without the output.
03 · Do the “Do this now” box
Fifteen to twenty minutes on your own data. This is the day; the reading is the preparation. Then press the tick button — it stores that day in this browser and moves the sidebar progress bar and this hub's percentage.
04 · Take the checkpoint before moving on
Each volume ends with a short self-test and a reference section. Answer from memory, then reveal. A wrong answer names the day to reread — that is cheaper now than at submission.
When you are stuck
In order: reread the error message aloud — R usually names the object it could not find; check you ran library() this session; ?function_name in the console; then the error decoder in Foundations. Ninety per cent of first-month errors are a typo, an unloaded package, or a column that is a character when you thought it was a number.
The three volumes you use out of order
Decisions when you do not know which model your design needs. Console to run R in this browser before anything is installed. Capstone from day 1 onward, to see which artefact each volume is quietly producing.
If you already know some R
Do not skip volumes — skim them and tick what you can already do, which takes an evening per volume and leaves the progress bars honest. Start properly wherever the checkpoint catches you out. Most people who think they can skip to Inference cannot reshape their own data yet.
The part nobody teaches

Design → model

Most people learn commands and still pick the wrong test. Answer three questions about your study and this gives you the model, the call, the effect size to report, and the mistake reviewers look for first.

1 · Your outcome variable is
2 · Your predictors are
3 · Observations are
Recommended
{{ recTitle }}
{{ recWhy }}
{{ recCode }}
Report
{{ recReport }}
The usual mistake
{{ recTrap }}

What you hold at the end

Courses produce certificates; applications need evidence. Each of these is produced as a by-product of a specific day, not as extra work. Tick them off as they exist.

How long, honestly

Arithmetic on the real minute estimates in these volumes, not an average. Pick the days per week you will actually manage.

{{ r.k }}
{{ r.v }}
{{ r.note }}

Six rules that decide whether this works

01
Type it, never paste it — the first time
The copy button exists for the second time, when you are reusing code in your own analysis. On the day you learn something, type it out and read the error messages. Errors are the curriculum.
02
Scripts, not the console
Anything you would be upset to lose goes in a script file. The console is scratch paper. This one habit is the difference between reproducible work and a folder of mysteries.
03 · Bring your own data by day 16
Teaching datasets are clean and therefore lie. From the wrangling volume onward, run every technique twice: once on the example, once on a messy file of your own. That second run is where learning happens.
04 · Write the sentence, then the code
Before any model, write the results sentence you expect to publish, with blanks where the numbers go. If you cannot write the sentence, the model is not the right one — no amount of R will fix that.
05 · Effect size and interval, always
Every test in this course is taught with its effect size and confidence interval attached. A bare p-value is no longer publishable in most behavioural journals, and it was never informative.
06
Commit the day you finish a volume
From day 90 your work is under version control. A commit history spread over four months is the most credible thing in an application — it cannot be faked the week before a deadline.

Install this much, and nothing else

Package sprawl is how beginners lose a week. Run these three lines on day 1; every later volume names its own additions on the day you need them.

install.packages(c( "tidyverse", # dplyr, ggplot2, tidyr, readr, stringr, forcats, lubridate "here", # sane file paths "readxl", "haven", # Excel and SPSS files "psych", # descriptives, reliability, EFA "effectsize", "emmeans", "afex", # effect sizes, contrasts, ANOVA "performance", "ggeffects", # diagnostics, model plots "lavaan", "lme4", "lmerTest", # SEM and mixed models "patchwork" # combining figures ))#> also installing dependencies ... #> * DONE (tidyverse)

Installing happens once per machine. library() happens once per session. Confusing the two is the most common first-week error, and the error message never says so.

Progress for every volume is stored in this browser only (keys r-found … r-predict, plus r-artefacts). Printed outputs are the real output of the code shown, from R 4.4 with current CRAN versions; your numbers will differ wherever a seed is not set. Statistical guidance here reflects current reporting standards in psychology — your discipline, supervisor and target journal outrank it.