The Book of R, Second Edition

I am the author of “The Book of R: A First Course in Programming and Statistics”, the second edition for which was released in November, 2025. It is published by No Starch Press (an independent publishing company who specialise in tech- and computer-based content). As the title suggests, it’s intended as a beginner-friendly introduction to the world’s most popular language for statistics and data science. A distinguishing feature of this book is that it eschews a blanket ‘cookie-cutter’ or ‘extendable template’ format (which is very common in this space, but can be rather limiting). It instead focuses on teaching the nuts-and-bolts of the core R language, both as a language in its own right and as a tool for statistical data analysis. Perhaps despite this, it is written specifically for individuals new to programming.

Downloadable resources

The book’s official webpage on the publisher’s site (2nd Edition, 1st Edition) contains links to download useful things like the R source files and a full set of solutions to the exercises.

Where to buy

If you buy a hard copy direct from the publisher’s site, you receive a DRM-free PDF file of the e-book version at no extra cost (buying direct from the publisher helps support their independence). You can also find it in all the usual places, like on Amazon (see here for the 1st Edition, here for the 2nd Edition).

Fun facts about the book

  • Motivated by creating a more formal text to use in my teaching, I started work on this book around 2014, at the time thinking “it won’t be too much extra work” to adapt course materials I had written for an introductory workshop. I was very wrong.

  • No Starch Press is based in San Francisco, CA, and as such, uses American spelling throughout. Drafting thus necessitated an intense period of breaking a lifelong habit of British spelling. Forcing myself to use ‘Z’ instead of ‘S’, use ‘O’ instead of ‘OU’, and relinquish my double-’L’s for mere single ’L’s, has still today left a lingering mental tic wherein I must pause before thinking about typing an offending word in any setting, including this website!

  • The first edition was published in 2016, and totals 832 pages (cover to cover). Early runs of the book were printed on thicker paper than later runs, meaning those early versions were heavier and visibly fatter than those in subsequent print cycles, despite identical source material.

  • Given various existing resources on R, I half thought the book would be little more that a personal endeavour. I’ve since been pleasantly surprised by its relative popularity – it’s even received official translations into Korean and simplified Chinese!

  • The second edition of the book will be published in 2025. It’s nearly 100 pages longer than the first edition (924 pages cover to cover). The newer edition took me almost as long to complete as writing the entire first edition outright – every word has been scrutinised!

  • I use examples and motivations from the book to teach my own undergraduate classes at the University of Otago, and the book has also been used as both recommended and suggested course material by instructors at US, UK, and European universities.

  • Count of children at publication of 1st Edition: 0. Count of children at publication of 2nd Edition: 2.