R Companion

R Companion

The R Companion is a chapter-by-chapter walkthrough that loads the dataset each chapter is built on, runs the headline analyses the chapter narrative describes, and reproduces the verified numbers in copy-pasteable R code. The full walkthroughs live online at stats.marginoferrormedia.com: searchable, with pre-rendered outputs, and updated whenever the book is corrected. The book’s reasoning stands on its own; the R Companion is there when you want to do the analysis yourself.

What each chapter’s walkthrough covers:

Each walkthrough loads the chapter’s dataset, runs the headline analyses, and reproduces the verified numbers in copy-pasteable R code. Click through to the chapter you want.

Each walkthrough begins with source("_common.R") to load tidyverse and the book’s color palette. Download _common.R if you want the chapter figures to match the book’s look, or replace the source() line with library(tidyverse). The analyses run either way.