Back to index
OtherAround 570 pages across 27 chapters, six to ten weeks doing the exercises·Free online, around $60 in print

R for Data Science, Second Edition (Wickham, Cetinkaya-Rundel and Grolemund)

4.6

The best free introduction to practical data analysis in any language, and the clearest example of a book that teaches a way of thinking rather than a set of functions. Its blind spot is that it teaches one dialect of R as though it were R.

What We Liked

  • Free online in full, permanently, with the print edition as an optional convenience
  • The tidy data concept is genuinely load bearing and transfers to every other tool you will use
  • ggplot2 coverage teaches a grammar rather than a chart menu, which pays off forever
  • Exercises are well judged, and the second edition's answers situation is much improved
  • Second edition modernised properly rather than being reprinted with a new cover

What Could Be Better

  • Teaches the tidyverse specifically, so base R remains a gap you have to fill elsewhere
  • Very little modelling content, since that moved out to a separate book that is less complete
  • R itself is losing ground to Python in machine learning, which limits where this takes you
  • Nothing on production concerns, packaging or putting analysis anywhere other than a document
  • The functional programming chapters are the weakest and lose readers who were doing fine

Detailed review

It is worth saying at the start that this book is free, complete, permanently online and better than most things people pay several hundred pounds for. That combination is rare enough to deserve comment before anything else. The reason it works is that Wickham is teaching a workflow rather than a language. The structure follows the actual shape of analysis.

You import data, you tidy it, then you cycle between transforming, visualising and modelling, then you communicate the result. That is what the work is, and organising a book around it means the reader is never learning a feature in isolation without knowing where it belongs. Most programming books are organised around the language's own structure, which is convenient for the author and leaves the reader with a pile of tools and no sense of sequence. The tidy data concept is the intellectual core and it is the part that will still be useful to you in a decade, in tools that have nothing to do with R.

Each variable a column, each observation a row, each type of observational unit a table. It sounds like a triviality when stated. In practice it is the difference between an analysis that flows and one where you spend eighty percent of your time reshaping things by hand. Once you have internalised it you start seeing untidy data as a specific diagnosable problem with a known fix, rather than as an inherent property of real world files.

I use this framing constantly in Python, where it is arguably more useful because pandas will happily let you avoid it. The visualisation chapters are the other standout. ggplot2 is an implementation of the grammar of graphics, which means you are not learning a list of chart types, you are learning that a plot is data plus a mapping plus geometric objects plus scales plus facets. Once that clicks you can construct a visualisation you have never seen before by composing pieces, and the chart menu approach in most tools starts to feel like a cage.

This is a genuinely superior way to think about graphics and it is worth learning even if you end up working elsewhere. The second edition is a real revision rather than a refresh. The data transformation material reflects how the tidyverse actually works now, the tidying chapters were restructured around functions that are much clearer than what they replaced, and there is more attention to the messy realities of importing files that were not designed for you. Cetinkaya-Rundel's involvement shows in the pedagogy, which is noticeably tighter than the first edition.

Exercises are well placed and appropriately difficult, and the solutions situation is better than it was, which used to be a common complaint. Now the honest problems, and the first one is philosophical. This book teaches the tidyverse, and it teaches it as though it were simply how R is written. It is not.

It is one dialect, a very good one, and R has a large base language and an enormous package ecosystem that does not follow these conventions. A reader who learns only from this book will be productive quickly and will then hit a wall the first time they open somebody else's code, or a package written before 2015, or a Stack Overflow answer using base R idioms. That transition is genuinely disorienting and the book does not prepare you for it or really acknowledge it. I would rather it spent twenty pages saying plainly that this is a dialect and here is what the rest looks like.

The modelling gap is the other structural issue. The first edition had modelling chapters, they were removed, and the replacement material lives in a separate book that has been less complete for a long time. That leaves this volume ending at communication, with the reader well equipped to explore and describe data and barely equipped to model it. For a book many people treat as their complete introduction to data science, that is a significant hole, and it means you need a second source before you can do anything predictive.

The functional programming material is the weakest section. Iteration and the map family are important and the treatment is abrupt compared to the patience shown everywhere else. Readers who were comfortable through the first twenty chapters commonly stall here. It reads like a chapter written for a different audience.

Then there is the language question, which is unavoidable in a catalogue like this one. R is excellent for statistics, exploratory work, research and reporting, and it has lost the machine learning ecosystem decisively to Python. If your goal is to train and deploy models, the tooling, the libraries, the job listings and the community are all somewhere else. This book will make you a good analyst and it will not put you on the path to being a machine learning engineer.

That is not a fault of the book but it determines who should read it. There is also nothing on production. No packaging, no testing beyond the basics, no deployment, no thought about analysis that runs on a schedule rather than in a session. The book ends where an analysis ends, which is fine for its intended audience and leaves a real gap for anybody whose work has to keep running.

My 4.6 is for a book that is free, superbly written, teaches concepts that outlast its own language, and has an unusually clear idea of what analysis actually involves. The tidyverse framing, the missing modelling material and R's narrowing position in machine learning are what keep it off the top.

[ final ]

The verdict.

If you are doing statistics, research or analysis, start here and do not hesitate. If your destination is machine learning engineering, learn Python instead and read this only for the tidy data ideas.