No. 143 of 500 No. 13 in Hands-On AI & Programming

R for Data Science

Import, Tidy, Transform, Visualize, and Model Data

By Hadley Wickham and Garrett Grolemund

Published
July 18, 2023
Print length
576 pages
Reading level
Beginner
ISBN-13
978-1492097402
Publisher
O'Reilly Media
Written for
Beginning and intermediate analysts learning R and the tidyverse for practical data analysis.

Synopsis

Hadley Wickham, the creator of the tidyverse, wrote R for Data Science with Garrett Grolemund to teach the full cycle of a data analysis: importing data, tidying it into a consistent structure, transforming and visualizing it, and communicating results. The first edition appeared in 2017; the substantially rewritten second edition, published in 2023 with Mine Çetinkaya-Rundel as a third author, is the current version. It opens with a whole-game overview that gets readers making plots with ggplot2 and manipulating data with dplyr almost immediately, before returning to each skill in depth.

The second edition adds chapters on numbers, logical vectors and missing values; a new section on importing data from spreadsheets, databases, large datasets via Arrow, hierarchical data and web pages; a rewritten programming section on functions and iteration; and Quarto in place of R Markdown for reports. The modeling chapters were dropped, with readers pointed to Tidy Modeling with R. Exercises appear throughout, and the full text is free at r4ds.hadley.nz under a Creative Commons license. Readers finish able to take messy real-world data to a reproducible, well-visualized analysis, though they will need other books for statistics and machine learning.

Scorecard

Editorial score

How it scored

Editorial score: 85.5 / 1005 weighted criteria

  • Influence30%

    25.5/30
  • Authority25%

    22.5/25
  • Practical value20%

    17.0/20
  • Currency15%

    12.0/15
  • Readability10%

    8.5/10
  • Editorial score

    85.5/100

How the rank was computed

Rank No. 143 of 500 comes from a composite of 60.1: observable signals 21.6 of 55 points plus editorial review 38.5 of 45 points.

All 11 inputs
InputPoints
Observable signals21.6/55
Reach (Amazon ratings volume)8.7/16.5
Consensus across best-of lists2.8/13.8
Awards and bestseller evidence0.0/8.3
Reader rating, sample-adjusted7.1/8.3
Amazon sales rank1.3/5.5
Recency1.7/2.8
Editorial review38.5/45
Author authority10.1/11.3
Influence11.5/13.5
Practical value7.7/9.0
Readability3.8/4.5
Currency5.4/6.8

Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.

Verdict

The standard hands-on introduction to tidyverse data science in R, clear enough for beginners and freely available online.

Strengths

  • Written by the tidyverse's creator
  • Free online with exercises and translations
  • Clear progression from first plot to programming

Keep in mind

The book is committed to the tidyverse, and the second edition omits modeling, so readers need other resources for statistics, machine learning or base R depth.

Key takeaways

  1. Tidy data, with one variable per column and one observation per row, makes import, transformation and plotting far simpler and more consistent.
  2. Visualization with ggplot2 is both an exploratory tool for understanding data and a communication tool, built up layer by layer from a grammar of graphics.
  3. A small set of dplyr verbs, such as filter, arrange, mutate and summarize, combined with grouping, handles most everyday data transformation tasks.
  4. Writing functions and using iteration reduces copy-and-paste errors, and Quarto documents combine code, results and prose into reproducible reports.

Notable facts

  • The full second edition is free to read at r4ds.hadley.nz under a Creative Commons license, with translations into Spanish, Turkish, Vietnamese and Arabic. Source (opens in a new tab)
  • The 2023 second edition added Mine Çetinkaya-Rundel as co-author and dropped the modeling section in favor of Tidy Modeling with R. Source (opens in a new tab)
  • Lead author Hadley Wickham received the 2019 COPSS Presidents' Award for influential work in statistical computing, visualization, graphics and data analysis. Source (opens in a new tab)

About the author

Hadley Wickham and Garrett Grolemund

Hadley Wickham is chief scientist at Posit (formerly RStudio) and an adjunct professor of statistics at the University of Auckland, Stanford and Rice. He created ggplot2, dplyr and the tidyverse, and won the 2019 COPSS Presidents' Award. His co-authors are Mine Çetinkaya-Rundel, a professor of the practice in statistical science at Duke University, and Garrett Grolemund.

Questions

Is R for Data Science good for beginners?
Yes. The book assumes no prior programming experience and starts by having readers create plots and transform data within the first chapters, then builds toward importing, cleaning and programming. Exercises reinforce each topic. Beginners should use the 2023 second edition, which reflects current tidyverse practice and is free online at r4ds.hadley.nz.
What changed in the second edition of R for Data Science?
The 2023 edition, which adds Mine Çetinkaya-Rundel as an author, was substantially rewritten. It adds chapters on numbers, logical vectors and missing values, new material on spreadsheets, databases, Arrow, hierarchical data and web scraping, a rebuilt programming section and Quarto for reports. The modeling section was removed, and readers are referred to Tidy Modeling with R.
Does R for Data Science cover machine learning?
No. The book focuses on the data workflow that precedes and surrounds modeling: importing, tidying, transforming, visualizing and communicating. The second edition removed the first edition's modeling chapters. Readers who want predictive modeling or machine learning in R should continue with Tidy Modeling with R by Max Kuhn and Julia Silge, which the authors recommend.

Sources

As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.