Learning Statistics with R
Preface

Back in the prehistory of humanity, somewhere around 2010, I was tasked with teaching an introductory statistics class for psychology students, and made the rather brave decision to teach it using the R statistical programming language. At the time, this was a risky decision: there were fewer novice-friendly resources back then, and there was no tidyverse available to provide a coherent and clean framework for using R. So I made do with what I had. I wrote my own lecture notes for the class, which eventually expanded to the point of becoming this book. Rather than sign a contract with a commercial publisher, I decided that it would be most useful for everyone if I released the work under a permissive creative commons licence, CC BY-SA 4.0, so that anyone could expand on it, reuse it, and adapt it to other contexts.
Since that time, there have been a surprising number of adaptations. I used to try to list them all on this page so that I could recommend alternative versions, but as the years rolled by I lost track. But I am grateful to everyone who has contributed to the work, in whatever capacity. It’s a little embarrassing to me that so many people found it useful. To everyone who has built on top of that work — thank you.
In any case I have finally, after an astonishingly long hiatus during which I left academia and am no longer working in psychology, managed to extract the contents from the original LaTeX/PDF framework in which it was written, and ported it into quarto. In doing so I have made a few minor improvements to the text, but for the most part it remains faithful to the original work. See the changelog page to see what has changed.
My personal view is that the book is an artifact of its time. It is not the book I would write now, but a lot of it is still as relevant as ever. I don’t know if I will ever be in a position to modernise it to reflect the current state of the R ecosystem. It would be nice, but I am no longer a teacher: I have a different job now and my focus is necessarily on that work. As a much smaller, more pragmatic gesture in that direction, I’ve gone back through the chapters and added a number of short “epilogue” sections wherever the surrounding text or the literature it cites has visibly aged — the state of the replication crisis, the \(p\)-value wars, the mainstreaming of Bayesian methods, and the rise of the tidyverse all get a paragraph or two of “here’s what’s changed since I wrote this” without my having rewritten the original material itself. It’s not a substitute for a proper modernisation, but it’s what I could manage. Even so, I am glad that I’ve been able to complete the port and make it available to the community.
The site you are currently on represents the HTML version of the book. Personally I prefer HTML to PDF, but for those of you who like having a self-contained PDF version, it’s available here. Older versions of the work are still accessible at old.learningstatisticswithr.com, on the off chance that anyone is still relying on them, but please be aware those will eventually disappear. The older versions are distressing for me to maintain, for personal reasons, and they will not be supported in the long term.
All the best,
Danielle