Written by Hadley Wickham, Mine Çetinkaya-Rundel, and Garrett Grolemund, this book teaches you how to do data science with R, RStudio, and the tidyverse, a collection of R packages designed to work together. It assumes no prior programming experience and aims to get you doing real data science quickly: importing data into R, tidying it into a useful structure, transforming and visualizing it, and communicating what you find.
Think of it as a practicum of the everyday skills that make data science possible. Alongside the code, it covers good workflow habits such as code style, scripts and projects, and asking for help with reproducible examples. The second edition is updated for the latest tidyverse features and best practices, adds new chapters on getting data from spreadsheets, databases, and websites, and uses Quarto for communicating results. Exercises throughout help you practice as you go.
The book covers:
- Taking a quick tour of the whole data science workflow
- Visualizing data with the layered grammar of graphics in
ggplot2 - Transforming logical vectors, numbers, strings, factors, dates and times, and missing values
- Matching patterns with regular expressions and combining tables with joins
- Importing data from spreadsheets, databases, Arrow and Parquet files, JSON, and web pages
- Programming with functions and iteration, plus a field guide to base R
- Communicating results with Quarto documents, presentations, and websites
The full book is free to read online, community translations are available in several languages, and suggested solutions to the exercises are published separately.

