The website of the second edition of R for Data Science (often shortened to R4DS) is a free online textbook, and its home page says it teaches you how to get your data into R, get it into the most useful structure, transform it and visualize it.[1] This article follows the book's home page, the preface to the second edition, the introduction, chapter 1 "Data visualization", the home page and chapter 2 of the solutions website, and the home page of the Data Science Learning Community; the pages are in English, and I accessed them on 26 November 2026. Some things first: I ran none of the book's code and did no exercise; apart from chapter 1 I read only the table of contents for the other 28 chapters; I read the introduction as far as the start of the acknowledgments and not the list of names; I did not open the first edition's site, the translations or the print book; I joined no book club or Slack; and of the solutions website I read only the home page and one chapter, and the page calls it a work in progress. Everything below relays the pages.
How the book is organised: six parts and a teaching order
By the sidebar's table of contents the book has six parts and 29 chapters after the introduction (the numbers of parts and chapters are my count): Whole game has 8 chapters, from data visualization, data transformation, data tidying and data import, interleaved with chapters on workflow, code style, scripts and projects, and getting help; Visualize has 3 (layers, exploratory data analysis, communication); Transform has 8 (logical vectors, numbers, strings, regular expressions, factors, dates and times, missing values, joins); Import has 5 (spreadsheets, databases, Arrow, hierarchical data, web scraping); Program has 3 (functions, iteration, a field guide to base R); and Communicate has 2 (Quarto and Quarto formats).[1] The introduction explains the order: learning data import and tidying first is suboptimal because 80% of the time it is routine and boring and the other 20% weird and frustrating, so the book starts with visualization and transformation of data that has already been imported and tidied, so that motivation stays high when you ingest and tidy your own data; each chapter starts with motivating examples to show the bigger picture and then dives into the details, and each section is paired with exercises.[3] It also says that about 80% of every project can be tackled with the tools in the book, that the remaining 20% needs other tools, and that the book points to resources for them throughout.[3]
![]()
Figure: A kākāpō perching among plants, an illustration only of the line on the book's home page that this bird appears on the cover of R4DS, and not the book cover nor related to the content of the book. Department of Conservation, Wikimedia Commons[7]
What changed in the second edition, and what the book does not teach
The preface to the second edition says it is a major reworking of the first, removing material no longer thought useful, adding material the authors wish they had included, and updating the text and code to reflect changes in best practice; it also welcomes a new co-author, Mine Çetinkaya-Rundel, a noted data science educator and a colleague at Posit (the company formerly known as RStudio).[2] The main changes it lists are these: the first part is renamed "Whole game" to give the rough details of the whole game of data science first; the "Visualize" part gives data visualization tools and best practices a more thorough coverage than the first edition, though the preface says the best place for all the details is still the ggplot2 book; the "Transform" part gains new chapters on numbers, logical vectors and missing values, which were previously parts of the data transformation chapter; "Import" is a new set of chapters that goes beyond flat text files to spreadsheets, databases, big data, rectangling hierarchical data and scraping websites; the "Program" part is rewritten from top to bottom, includes how to wrap tidyverse functions (tidy evaluation) and adds a chapter on base R functions seen in wild-caught R code; "Communicate" is updated to feature Quarto instead of R Markdown, and this edition was itself written in Quarto; and the modelling part was removed, with the preface recommending the tidymodels packages and Tidy Modeling with R by Max Kuhn and Julia Silge.[2] The introduction's "what you won't learn" also lists big data (the book focuses on small in-memory datasets, which the page says it handles up to hundreds of megabytes and, with care, a few gigabytes, and for 10 to 100 GB it recommends learning data.table) and Python, Julia and other languages (it says it is best to master one tool at a time).[3] The home page says the website is and will always be free under the CC BY-NC-ND 3.0 licence, that a physical copy can be bought, and that if you want to give back you can donate to Kākāpō Recovery, the bird being critically endangered with only 244 left, as the page puts it.[1]
Software, exercises and answers: what to prepare before you start
The introduction's prerequisites are that you are generally numerically literate and that some basic programming experience helps; if you have never programmed, it suggests Garrett's Hands on Programming with R as an adjunct.[3] To run the code you need four things: R, RStudio, the tidyverse and a handful of other packages; the page recommends R 4.2.0 or later and RStudio 2022.02.0 or later, the install.packages command in the introduction lists 19 other packages used in the book (my count), and it says a selection of further packages is used for one-off examples, to be installed when you meet a "no package called" error.[3] Chapter 1 uses the penguins data from the palmerpenguins package to teach aesthetic mappings and geometric objects in ggplot2, how to draw distributions and relationships, how to save plots and what to do about common problems; its sections are Introduction, First steps, ggplot2 calls, Visualizing distributions, Visualizing relationships, Saving your plots, Common problems and Summary, and I counted four sets of exercises (my count).[4] The home page says suggested answers to the exercises are on Mine Çetinkaya-Rundel's solutions website.[1] The solutions home page calls itself a work-in-progress site, names Jabir Ghaffar, Davon Person and Mine Çetinkaya-Rundel as the authors and says it was built with Quarto; it counts the introduction as chapter 1, so its chapter numbers are one higher than the book's, and the chapter I read, "2 Data visualization", corresponds to chapter 1 of the book; the package versions printed in that chapter's output (for example ggplot2 3.4.2) are older than those printed in the book's chapter 1 (ggplot2 4.0.4), so when you check your work against it, remember that the output may differ from the versions you have installed.[5]
Learning together: the community, and what I did not read
The home page of the Data Science Learning Community (dslc.io) describes a friendly, inclusive community of data science learners and practitioners that organises book clubs, in which members have read dozens of books in small cohorts that meet every week; members help one another by asking and answering programming questions in Slack help channels, are encouraged to share their work, and take part in the weekly TidyTuesday social data project.[6] The page I read does not name R4DS, so whether there is a book club for this book, and whether it is running now, I did not check, and I did not join the Slack. The home page also lists second-edition translations in Spanish, Turkish, Vietnamese and Arabic and first-edition translations in Spanish, Italian, Turkish and Portuguese, and I read nothing about the quality or currency of those translations.[1] In my judgment, you could study it by following the table of contents from "Whole game" and doing the exercises of each section before moving on; trying the exercises yourself before looking at the solutions website is my suggestion, not something the pages say; and when you are stuck, search the error message first and then ask the community. Remember that the solutions website is a work in progress and that its chapter numbers and package versions do not fully match the book.[1][5][6] I ran no code, did no exercise, read the text of no chapter other than chapter 1, and read nothing of the first edition, the translations, the print book or the Slack, so I say nothing about them; the above relays the pages and may contain errors.
References
- Hadley Wickham, Mine Çetinkaya-Rundel, Garrett Grolemund. R for Data Science (2e), book home page, accessed 26 November 2026.
- Preface to the second edition, R for Data Science (2e), accessed 26 November 2026.
- Introduction, R for Data Science (2e), accessed 26 November 2026.
- 1 Data visualization, R for Data Science (2e), accessed 26 November 2026.
- Jabir Ghaffar, Davon Person, Mine Çetinkaya-Rundel. R for Data Science (2e) - Solutions to Exercises, solutions website, accessed 26 November 2026, home page and chapter 2 only.
- Data Science Learning Community. dslc.io, community home page, accessed 26 November 2026.
- Department of Conservation. Kakapo Sirocco 1.jpg, Wikimedia Commons, CC BY 2.0.