Key points
- The first edition’s website calls the book out of date and recommends the second edition. (Source: https://r4ds.had.co.nz/)
- The first edition is free to read in full online; its contents include modeling and R Markdown. (Source: https://r4ds.had.co.nz/)
- The second edition expands visualization, transformation, and import coverage, and rewrites the programming material. (Source: https://r4ds.hadley.nz/preface-2e)
- The second edition removes the modeling part and replaces R Markdown with Quarto in its communication coverage. (Source: https://r4ds.hadley.nz/preface-2e)
- Which first-edition chapters have no counterpart in the second?
- What the first edition’s website says
- What the second edition’s preface says
- The documented differences side by side
- Which edition fits spreadsheets, databases, or modeling?
- What we counted in the two editions’ tables of contents
- What a chapter count cannot tell you
- Related posts
Which first-edition chapters have no counterpart in the second?
Choose the second edition as your starting point: the first edition’s own website recommends it, and the second-edition preface describes substantial revisions. Choose the first edition specifically when you want to consult its modeling or R Markdown chapters.
Before considering a purchase, the first edition’s full text is free to read online at the authors’ website. Its welcome page explicitly says the website is free to use and will remain so. You can therefore consult that edition’s material without buying a physical copy.
R4DS is a book about doing data science with R, including importing, structuring, transforming, and visualizing data.
The decision is about coverage as well as edition labels. The second edition adds material, expands existing subjects, and changes the communication tool it teaches. It also removes the modeling part. That combination matters if you are choosing a book around a particular task: the recommended edition does not retain every subject from its predecessor.
The authors’ pages provide a clear basis for choosing a starting point and identifying these differences. The first edition’s welcome page supplies its recommendation and contents; the second edition’s preface explains what changed.
What the first edition’s website says
The first edition’s welcome page describes a practical introduction to data science skills. Its account includes getting data into R, arranging it into a useful structure, transforming it, visualizing it, and modeling it. It also names the grammar of graphics, literate programming, and reproducible research.
Its contents organize that work into Explore, Wrangle, Program, Model, and Communicate. Under Wrangle, the listed subjects include tibbles, data import, tidy data, relational data, strings, factors, and dates and times. Program includes pipes, functions, vectors, and iteration.
The modeling section is a concrete reason to distinguish the editions. The following lines are reproduced directly from the website’s table of contents:
23 Model basics
24 Model building
25 Many models
Source: First edition website, retrieved 2026-10-23.
Communication is another identifiable difference. The first edition lists “R Markdown,” “Graphics for communication,” “R Markdown formats,” and “R Markdown workflow.” If those are the chapter subjects you need to consult, the contents identify where they sit in this edition.
These retained subjects do not change the website’s overall recommendation. The welcome page explicitly calls the first edition out of date and directs readers to the second. Treat the first edition as a deliberate choice for its documented coverage, with the authors’ recommendation in view.
What the second edition’s preface says
The second-edition preface describes a major reworking: material was removed, new material was added, and text and code were updated to reflect changes in best practices.
The opening part is now “Whole game.” Its stated goal is to introduce the rough details of the whole data science process before examining individual topics more closely. This gives the opening section an explicit role within the revised organization.
“Visualize” offers more thorough coverage of visualization tools and best practices than the first edition. The preface says R4DS now covers more of the important techniques, while still directing readers to the ggplot2 book for fuller detail.
“Transform” gains dedicated chapters on numbers, logical vectors, and missing values. The authors explain that these subjects previously appeared within the data transformation chapter and needed more space. This is an expansion of existing subject matter into separate chapters.
“Import” broadens the scope beyond flat text files. The preface names spreadsheets, databases, big data, hierarchical data, and web scraping. Its contents give these areas visible chapter entries, including “Spreadsheets,” “Databases,” “Arrow,” “Hierarchical data,” and “Web scraping.”
The programming part has been rewritten around function writing and iteration. It now includes wrapping tidyverse functions and handling the associated tidy evaluation challenges. A new chapter covers important base R functions readers are likely to encounter in existing R code.
The removal of modeling is explicit:
“The modeling part has been removed.”
Source: Preface to the second edition, retrieved 2026-10-23.
The authors explain that they lacked room to cover modeling adequately and recommend the tidymodels packages and Tidy Modeling with R as alternatives. Finally, “Communicate” has been updated to feature Quarto instead of R Markdown. The contents list “Quarto” and “Quarto formats.”
The documented differences side by side
This comparison uses chapter titles and changes stated on the authors’ pages. In particular, the import column distinguishes the first edition’s listed chapter from the second edition’s explicitly expanded import part.
| Edition | Import coverage named on the pages | Programming coverage | Modeling | Communication |
|---|---|---|---|---|
| First edition | “Data import” | “Pipes,” “Functions,” “Vectors,” “Iteration” | “Model basics,” “Model building,” “Many models” | “R Markdown,” “Graphics for communication,” “R Markdown formats,” “R Markdown workflow” |
| Second edition | “Spreadsheets,” “Databases,” “Arrow,” “Hierarchical data,” “Web scraping” | Rewritten function writing and iteration; wrapping tidyverse functions; “A field guide to base R” | Modeling part removed | “Quarto,” “Quarto formats” |
Sources: First edition website and second-edition preface, retrieved 2026-10-23.
The differences point to distinct reasons for consulting each edition. Expanded import coverage supports choosing the second edition for the data sources named in its preface. The retained modeling and R Markdown chapters support consulting the first edition for those subjects.
The programming comparison also requires attention to the preface, rather than chapter names alone. Both editions include functions and iteration, but the authors explicitly describe the second edition’s programming material as rewritten. Shared subject names therefore coexist with a stated change in treatment.
Which edition fits spreadsheets, databases, or modeling?
For a general starting point, follow the authors’ recommendation and choose the second edition of R for Data Science. Its documented revisions cover visualization, transformation, importing, programming, and communication.
For work involving spreadsheets, databases, hierarchical data, or web scraping, the second edition has the clearest match in its stated scope. Those subjects are explicitly named in the new import part. The preface also identifies working with big data as part of that expansion.
For a focus on numbers, logical vectors, or missing values, the second edition provides dedicated chapters. The authors’ explanation is useful here: these subjects received additional room because their earlier placement within data transformation was insufficient for the detail they wanted to cover.
For function writing, the second edition explicitly includes wrapping tidyverse functions and the challenges of tidy evaluation. That is a specific documented addition to consider if it matches your learning goal.
For the first edition’s modeling sequence or its R Markdown chapters, consult the free first edition of R for Data Science. Its online contents identify those sections directly. For Quarto coverage, choose the second edition, whose communication part explicitly makes that switch.
These choices can be made by subject. You can follow the authors’ recommended starting edition while consulting the earlier online text for a chapter it retains.
If R is one of several options you are weighing, our other comparisons may help: Introduction to Statistical Learning or Elements of Statistical Learning for the statistics side, Hands-On Machine Learning, 2nd or 3rd edition for the Python machine-learning side, and Python Crash Course or Automate the Boring Stuff if you are choosing a first Python book instead.
What we counted in the two editions’ tables of contents
We counted chapters rather than relying on the prefaces’ descriptions. On 2026-11-19 we fetched the first edition’s welcome page (r4ds.had.co.nz) and the second edition’s source file that defines its table of contents (_quarto.yml in the authors’ GitHub repository, main branch; the latest commit on that branch was dated 2026-10-23).
| Edition | What we counted | Count |
|---|---|---|
| First edition | Distinct chapter pages linked from the welcome page (introduction plus chapters, section-intro pages excluded) | 25 |
| First edition | Section-intro pages (explore, wrangle, program, model, communicate) | 5 |
| Second edition | Chapters listed in _quarto.yml (introduction and preface not counted) |
29 |
| Second edition | Parts listed in _quarto.yml |
6 |
The first edition’s 25 includes its introduction; the second edition’s 29 does not, because the file lists the introduction and preface separately. Counted the same way, the first edition has 24 chapters, so the second edition lists five more. The first edition’s count includes three modeling chapters; the second edition’s list has none, which matches the preface’s statement that the modeling part was removed.
To repeat the counts:
curl -sL https://r4ds.had.co.nz/ | grep -o 'href="[a-z0-9-]*\.html' | sort -u | grep -vc -e index -e -intro
curl -sL https://raw.githubusercontent.com/hadley/r4ds/main/_quarto.yml | grep -E '^\s*-\s+[A-Za-z0-9-]+\.qmd' | wc -l
curl -sL https://raw.githubusercontent.com/hadley/r4ds/main/_quarto.yml | grep -cE '^\s*-\s+part:'
These printed 25, 32 and 6 when we ran them. The middle number includes the index, preface and introduction files, so 32 minus 3 gives the 29 chapters. A chapter count says nothing about length, depth or quality, and we did not measure page counts or word counts. We also did not run any code from either book.
What a chapter count cannot tell you
The welcome page, preface, and contents do not establish how long either edition takes to complete, how difficult particular exercises are, or which explanations you will find easier to follow. They also do not provide a measured comparison of learning outcomes.
The first edition’s modeling chapter titles identify coverage, but they do not establish that those chapters meet every modeling goal. Likewise, the second edition’s expanded import topics do not establish support for every spreadsheet layout, database system, or website.
The pages describe revisions without providing a complete, example-by-example compatibility comparison. They cannot establish that every older code example works unchanged in your environment.
The recommendation here rests on the authors’ stated edition preference and documented changes in subject coverage. It is not a review based on reading both books or testing their examples.

Comments