Edition 1·Updated 2026-10-03·20 min read
Sources
About this book
An overview of the book, with source information for further reading.
A practical, hands-on guide to doing data science in R using the tidyverse, walking the reader through the complete workflow of importing, tidying, transforming, visualizing, modeling, and communicating data.
R for Data Science teaches you how to turn raw data into understanding, insight, and knowledge using R and the tidyverse collection of packages. Rather than starting with the boring parts (data ingest and cleaning), the book begins with visualization and transformation of clean data so your motivation stays high, then progressively layers in programming skills, data wrangling, modeling, and communication. Written by Hadley Wickham (creator of much of the tidyverse) and Garrett Grolemund, the book unabashedly focuses on the most important 80% of data science tasks—hypothesis generation and exploratory data analysis on rectangular, in-memory datasets—giving you a coherent, opinionated toolkit (ggplot2, dplyr, tidyr, readr, purrr, and more) that share a common philosophy and work together naturally. By the end you'll have a reusable mental model of the data science process and the concrete R skills to execute it, plus pointers to deeper resources for the remaining 20%.
Movement I
Orient
What this book claims, and who wrote it.
- — The book's one-line promise
- — The author and where the book stands
A practical, hands-on guide to doing data science in R using the tidyverse, walking the reader through the complete workflow of importing, tidying, transforming, visualizing, modeling, and communicating data.
The need-to-know
Data science follows a repeatable workflow: import, tidy, transform, visualize, model, and communicate, all surrounded by programming. Tidy data—where each variable is a column, each observation a row, and each value a cell—is the consistent structure that lets tidyverse tools work together naturally. The grammar of graphics provides a coherent system to build any plot from data, geoms, aesthetic mappings, stats, position adjustments, coordinate systems, and facets.
About this guide
The guide describes these challenges, steps and possible outcomes.
Who it is for
An aspiring or working data analyst who wants to turn raw data into understanding, insight, and knowledge and tackle a wide variety of data science challenges.
Challenges
- In practice · They have data but lack a coherent, efficient toolkit and workflow to import, clean, explore, model, and communicate it in R.
- For the reader · They feel frustrated and overwhelmed by R's pickiness and the sprawling, inconsistent landscape of tools and techniques.
Steps to consider
- 1Install R, RStudio, and the tidyverse.
- 2Start with visualization and transformation of clean data to build momentum.
- 3Learn exploratory data analysis to ask and answer questions about data.
- 4Wrangle messy data into tidy form using import and tidying tools.
- 5Acquire programming skills (functions, vectors, iteration) to tackle harder problems.
- 6Use models to extract patterns and residuals from data.
- 7Communicate results reproducibly with R Markdown.
Risks
You remain stuck fighting your data into the right form instead of answering real questions. You make incidental copy-and-paste errors and create inconsistent, buggy analyses.
Intended result
You can tackle about 80% of any data science project with the tools you've learned. You generate many promising leads through rapid, iterative data exploration.
Set the record straight
What this book sets straight
The common beliefs this book pushes back on.
You should start learning data science by mastering data ingest and cleaning first.
Start with visualization and transformation of already-clean data so your motivation stays high; tidying is boring 80% of the time and frustrating the rest, a bad place to begin.
Modeling is for hypothesis confirmation and visualization is for hypothesis generation.
That's a false dichotomy; both can be used for exploration. The key distinction is how often you look at each observation—once is confirmation, more than once is exploration.
You should learn many programming languages and tools at once to be a well-rounded data scientist.
It's best to master one tool at a time; you learn faster by diving deep into R, an environment designed from the ground up for data science.
for loops are slow and should be avoided in R.
for loops are not slow; the chief benefit of map functions over loops is clarity, not speed.
A good model is one that is true.
All models are wrong but some are useful; the goal is a simple, illuminating approximation, not truth.
Movement II
Map
The book's main ideas and how they connect.
R for Data Science's own model — and how it sits inside its field.
- — 10 constructs the book works with
- — Where it agrees with the field, exceeds it, or fills a gap
The constructs
How they connect (12)
- Tidy Data Adoption → predicts → Cognitive Clarity
- Integrated Toolkit Use → predicts → Cognitive Clarity
- Tidy Data Adoption → influences → Integrated Toolkit Use
- Cognitive Clarity → predicts → Iterative Exploration Behavior
- Analyst Motivation → predicts → Iterative Exploration Behavior
- Integrated Toolkit Use → influences → Analyst Motivation
- Code Duplication Reduction → predicts → Analytic Productivity
- Iterative Exploration Behavior → predicts → Insight Generation
- Code Duplication Reduction → predicts → Cognitive Clarity
- Cognitive Clarity → predicts → Analytic Productivity
- Reproducible Communication Behavior → influences → Insight Generation
- Data Complexity and Messiness → moderates → Tidy Data Adoption
Where this book diverges from the corpus
- fills gap A consistent data-storage convention (variable=column, observation=row) is a technical data-practice construct that the software-team field model does not cover at all.
- fills gap The field touches tool choice only as team autonomy and conceptual integrity of design, not the use of a coherent, interoperable analysis toolkit.
- fills gap The DRY principle and function/iteration extraction are a concrete coding practice absent from the field's team- and process-level constructs, which only touch code quality via accountability and product quality.
- fills gap Reduced cognitive load from consistent tools and data forms is about individual attention on substantive questions, not the field's role/strategic clarity, so it is uncovered.
- exceeds The field emphasizes team meetings and specifications for alignment, whereas the book operationalizes communication as executable, re-runnable documents that bind prose, code and results.
- fills gap Discovering true patterns in data is an analytic outcome with no counterpart among the field's delivery, quality, and organizational-success outcomes.
Movement III
Master
Explore the book's ideas, examples and practical tools.
How the author makes the case — section by section, with the book's own tools.
- — 10 sections, in the book's order
- — The book's frameworks, checklists, and worked cases
strong · 1 source
- R for Data Science
This section lays out the loop of question, visualize, transform, model, and refine. It shows how to run that loop fast enough to produce many leads.
Iterative Exploration Behavior
The behavioral pattern of rapidly generating questions, visualizing, transforming, and modeling data, then refining questions and repeating, to generate many promising leads about the data.
Why it matters. Exploration yields insight only when cycles are cheap and plentiful; slow cycles turn it into a few expensive guesses.
Myth
Exploration is aimless fiddling that should be replaced by a fixed analysis plan fixed before touching the data.
Reality
Exploration is a disciplined loop in which each plot or model sharpens the next question. The aim is quantity of promising leads, which a pre-fixed plan would never surface.
- Iterative Exploration BehaviorFramework — How this mechanism is run, step by step, as the literature describes it.
- Iterative Exploration Behavior — decision rulesChecklist — 5 checkpoints
- Iterative Exploration BehaviorCase study — Start with the question: how are the values of `y` in `diamonds` distributed?
- Speed of the question-plot-refine loop determines how many leads you generate.
- Each result should produce a sharper next question, not an endpoint.
- Exploration yields hypotheses; confirm them separately.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “EDA Loop Log” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 3 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section shows how to weave prose, code, and output into a single re-runnable document. It focuses on capturing reasoning, not only results.
Reproducible Communication Behavior
The practice of integrating prose, code, and results into reproducible documents (R Markdown) and capturing reasoning so analyses can be understood, re-run, and shared with others.
Why it matters. An analysis nobody can re-run or follow cannot be trusted, checked, or built on, including by you six months later.
Myth
Reproducible documents are a reporting step for the end, after the real analysis is finished elsewhere.
Reality
The document works best as the place you do the analysis. Writing reasoning alongside code as you go captures decisions that are impossible to reconstruct later, and it makes the final report a by-product.
- Reproducible Communication BehaviorFramework — How this mechanism is run, step by step, as the literature describes it.
- Reproducible Communication Behavior — decision rulesChecklist — 5 checkpoints
- Reproducible Document Pre-Share ChecklistTemplate
- Do the analysis in the document so reasoning is captured at the moment you have it.
- A clean-session render is the proof of reproducibility.
- Inline results from code keep prose and numbers consistent.
The deep drill-down: 9 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Reproducible Document Pre-Share Checklist” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 3 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section defines the payoff of the whole workflow: reliable understanding drawn from data. It shows how to tell real signal from noise and find subtler signals.
Insight Generation
The outcome of discovering true patterns and relationships in data—turning raw data into understanding, insight, and knowledge—while filtering out noise and recognizing the subtler signals that remain after removing strong patterns.
Why it matters. The purpose of every earlier practice is to produce true patterns, and mistaking noise for signal produces confident but wrong conclusions.
Myth
An insight is any striking pattern that shows up clearly in a plot.
Reality
A striking pattern may be sampling noise, a confounded relationship, or a data artifact. Real insight survives checking, and often emerges only after you model out the strong pattern and examine the residuals.
- Insight GenerationCase study — The source's baseball case.
- A pattern becomes an insight only after it survives checks for chance and confounding.
- Residuals from a model of the strong pattern are where subtler signals appear.
- State each finding with its evidence and caveats.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Insight Audit Sheet” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 1 tool for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section describes productivity as breadth plus efficiency: handling most project needs quickly and with few errors. It identifies the practices that drive it.
Analytic Productivity
The outcome of being able to tackle a wide variety of data science challenges efficiently—covering roughly 80% of project needs with fewer errors, faster iteration, and less rework.
Why it matters. Productivity gains compound across projects, while rework and avoidable errors consume the time that deeper analysis needs.
Myth
Analytic productivity means writing code faster or learning more packages.
Reality
Speed of typing matters little next to avoided rework. Productivity comes from fewer errors, reusable functions, and clear structure, and mastering a small core of tools covers most needs.
- Analytic ProductivityFramework — How this mechanism is run, step by step, as the literature describes it.
- Analytic Productivity — decision rulesChecklist — 5 checkpoints
- Analytic ProductivityCase study — Take the flights-by-destination analysis.
- Fewer errors and less rework drive productivity more than raw coding speed.
- A small, well-mastered core covers most project needs.
- Reusable functions turn this project's effort into the next project's head start.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Analysis Project Readiness Checklist” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 3 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section treats messiness, non-rectangular structure, and size as conditions that change how well standard practices work. It helps you judge when the usual tidy workflow suffices.
Data Complexity and Messiness
The contextual condition describing how messy, non-rectangular, or large a dataset is, which conditions how strongly tidy practices and the integrated toolkit translate into productivity gains.
Why it matters. Knowing your data's complexity tells you whether tidy practices will pay off quickly or need extra work, so you avoid blaming the method for a mismatch.
Myth
If the tidyverse workflow struggles with a dataset, the analyst or the method must be doing something wrong.
Reality
Some data, such as hierarchical JSON, very large tables, or heavily irregular spreadsheets, strains rectangular tidy structure by nature. Gains shrink or require added steps, and recognizing this is a diagnosis, not a failure.
- Assess complexity up front to predict how much reshaping work lies ahead.
- Nested and very large data need extra steps, such as unnesting or database backends, before standard verbs apply.
- Smaller gains on messy data signal a harder input, not a flawed method.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Messiness Triage Card” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section shows how to reshape data so storage structure mirrors dataset meaning. It covers the tidyr moves that make every later dplyr and ggplot2 step shorter.
Tidy Data Adoption
The degree to which an analyst stores data in a consistent form where each variable is a column, each observation is a row, and each value is a cell, matching dataset semantics to storage structure.
Why it matters. Get the structure right and each downstream verb works without special handling; get it wrong and you write bespoke reshaping code before every plot and model.
Myth
Tidy data means a long, narrow table, so the goal is to pivot everything longer.
Reality
Tidy is defined by semantics: one variable per column, one observation per row. The same table can be tidy for one question and untidy for another, depending on what counts as the observation. Direction of pivot is a consequence, not the rule.
- Data Complexity and MessinessFramework — How this mechanism is run, step by step, as the literature describes it.
- Insight GenerationFramework — How this mechanism is run, step by step, as the literature describes it.
- Tidy Data AdoptionFramework — How this mechanism is run, step by step, as the literature describes it.
- Data Complexity and Messiness — decision rulesChecklist — 5 checkpoints
- Tidy Data Adoption — decision rulesChecklist — 5 checkpoints
- Data Complexity and MessinessCase study — Take the params example from the list chapter.
- Reproducible Communication BehaviorCase study — You get stuck on a problem in a dataset and want help.
- Tidy Data AdoptionCase study — The passages' challenge.csv import shows the principle at the column level.
- Analysis Project Readiness ChecklistTemplate
- Messiness Triage CardTemplate
- DRY Extraction ChecklistTemplate
- Insight Audit SheetTemplate
- Tidyverse Pipeline Audit SheetTemplate
- Tidy Data Shape CheckTemplate
- Define the observation first; tidiness follows from that choice, not from a table's shape.
- If a ggplot2 aesthetic needs several columns combined, the data is probably untidy.
- Tidy once, upstream, and every later transformation stays short.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Tidy Data Shape Check” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 14 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section explains why staying inside the tidyverse's shared conventions pays off, and how to use its packages as one system. It is about consistency across tools rather than any single function.
Integrated Toolkit Use
The extent to which an analyst uses a coherent, philosophically consistent set of tools (the tidyverse: ggplot2, dplyr, tidyr, readr, purrr) designed to work together naturally rather than ad hoc, inconsistent tools.
Why it matters. Tools that share a data-frame-in, data-frame-out grammar let you chain steps; mixing idioms forces constant translation and adds subtle bugs.
Myth
The tidyverse is just a stylistic preference, and base R or a patchwork of packages does the same job equally well.
Reality
The value lies in interface consistency: shared argument order, pipe-friendly design, and predictable output types. A patchwork of tools with different conventions taxes you at every handoff, even when each tool is individually capable.
- Integrated Toolkit UseFramework — How this mechanism is run, step by step, as the literature describes it.
- Integrated Toolkit Use — decision rulesChecklist — 5 checkpoints
- Integrated Toolkit UseCase study — The readr challenge.csv example shows the toolkit's discipline at the import stage.
- Consistency across packages is the benefit; no single package delivers it alone.
- A pipeline that reads top to bottom as a sequence of verbs is your working test of integration.
- Bring outside tools in through data-frame-shaped wrappers.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Tidyverse Pipeline Audit Sheet” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 3 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section covers when and how to turn copied code into functions and iteration. It gives you a trigger for refactoring and a path to do it safely.
Code Duplication Reduction
The practice of extracting repeated code into functions and using iteration tools to avoid copying and pasting, following the Don't Repeat Yourself principle to reduce errors and clarify intent.
Why it matters. Every pasted block is a place where a fix gets applied to one copy and missed in the others, so duplication quietly produces inconsistent results.
Myth
Writing functions is an advanced software-engineering skill that analysts should postpone until their scripts are large.
Reality
The payoff starts at the third copy-paste, well before a script is large. A function gives a repeated operation a name that states your intent, and a change to it propagates everywhere.
- Code Duplication ReductionFramework — How this mechanism is run, step by step, as the literature describes it.
- Code Duplication Reduction — decision rulesChecklist — 6 checkpoints
- Three copies is the trigger for extracting a function.
- Arguments should be only the parts that actually differ between copies.
- Iteration with map() or across() replaces pasted blocks and states the intent directly.
The deep drill-down: 8 operational steps, a worked example from the source, 6 decision rules, 6 failure modes, and the “DRY Extraction Checklist” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 2 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section treats motivation as something you design into your workflow. It shows how to sequence work so persistence survives the dull parts.
Analyst Motivation
The psychological state of sustained engagement and willingness to persist through frustration, kept high by experiencing early payoff from visualization before enduring tedious tasks like data ingest and tidying.
Why it matters. Analysts who hit ingest and cleaning chores before seeing anything stop before the data has told them anything.
Myth
Motivation is a personal trait of disciplined analysts, so it falls outside the workflow.
Reality
Persistence is partly structural: seeing a first plot early makes later tedium feel purposeful. Tool design that shortens the path from data to picture raises engagement, so you can engineer it.
- Analyst MotivationFramework — How this mechanism is run, step by step, as the literature describes it.
- Analyst Motivation — decision rulesChecklist — 5 checkpoints
- Analyst MotivationCase study — The book's own sequence is the example.
- Payoff-Before-Pain Motivation CardTemplate
- Put a visualization early in the workflow to earn the patience tedious steps require.
- Motivation responds to workflow design, so adjust the order of work when it flags.
- An early look also prioritizes which cleaning is worth doing.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Payoff-Before-Pain Motivation Card” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 4 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
strong · 1 source
- R for Data Science
This section describes the freed-up attention that good structure and consistent code give you. It shows how to spot and remove sources of mental overhead.
Cognitive Clarity
The reduced cognitive load and increased ability to focus attention on substantive data questions rather than on wrangling data into the right form or deciphering inconsistent tools and code.
Why it matters. Attention spent on reshaping data or decoding code is attention not spent on the question, so clarity decides whether your thinking reaches the data.
Myth
Cognitive load is a fixed cost of data analysis that experience eventually makes disappear.
Reality
Experience helps, but much of the load is imposed by the data structure and code you choose. Tidy layouts, one toolkit, and named functions remove demands on working memory, even for experts.
- Cognitive ClarityFramework — How this mechanism is run, step by step, as the literature describes it.
- Cognitive Clarity — decision rulesChecklist — 5 checkpoints
- Cognitive ClarityCase study — The source's flights example shows the shift in load.
- Clarity comes from structure, consistency, and naming, and all three are within your control.
- A cold reread of your own code is a quick test of clarity.
- Fix recurring friction at its source rather than absorbing it each time.
The deep drill-down: 8 operational steps, a worked example from the source, 5 decision rules, 5 failure modes, and the “Clarity Pass Checklist for an Analysis Script” tool. Included when you buy this guide.
The rest of this section
the full written section · 4 how-to steps · 2 pitfalls to watch for · 3 tools for this section. Included when you buy this guide.
Grounded in: R for Data Science
Movement III · The run-it-now depth
The Playbook
Practical tools and examples from this guide.
Frameworks
Analyst Motivation
How this mechanism is run, step by step, as the literature describes it.
- 1Start with visualization and transformation on data that is already imported and tidied. The book's rationale: ingest and tidying are 80% routine and boring and 20% weird and frustrating, which is a bad place to start learning. Begin where the payoff is clear.
- 2Run library(tidyverse) and make your first ggplot2 plot early. Visualization is the best entry point because you get elegant, informative plots that help you understand data. Record what you learned from that first plot as your payoff memory.
- 3Treat the payoff as a stored reason to persist. When you later ingest and tidy your own data, your motivation stays high because you know the pain is worth it. Before starting an ingest task, name the plot or question the cleaned data will feed.
- 4Expect frustration and label it as normal. R is a stickler for punctuation and one misplaced character makes it complain. The source calls this typical and temporary: it happens to everyone, and the only way past it is to keep trying.
- 5Keep the loop short: look at the data, generate hypotheses, test them quickly, repeat. Data exploration is meant to produce many promising leads, so each cycle should end with something you can see.
- 6Defer what you cannot yet use. Modeling waits until Part IV, once you have more wrangling and programming tools. Programming is a long-term investment that does not pay off immediately, so do not expect instant returns from it.
- 7Do the exercises. The source admits it is tempting to skip them but says there is no better way to learn than practicing on real problems.
- 8Keep your code organized from the start, using the workflow chapters (2, 4, 6) on writing and organizing R code. That prepares you to stay organized when you tackle real projects, which is where tedium peaks.
Analytic Productivity
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Cognitive Clarity
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Data Complexity and Messiness
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Code Duplication Reduction
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Insight Generation
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Integrated Toolkit Use
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Iterative Exploration Behavior
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Reproducible Communication Behavior
How this mechanism is run, step by step, as the literature describes it.
◆ The full 9-step framework — included with this guide purchase
Tidy Data Adoption
How this mechanism is run, step by step, as the literature describes it.
◆ The full 8-step framework — included with this guide purchase
Checklists
Analyst Motivation — decision rules
- If you are about to begin with ingest and tidying of a new dataset, then first produce one plot from an already-tidy dataset so the payoff is fresh.
- If R rejects your code over a single character, then treat it as normal, check punctuation, and keep trying rather than abandoning the task.
- If you feel pulled toward modeling before you have wrangling and programming skills, then defer it to after Part IV.
- If you are tempted to skip an exercise, then do it anyway, because practice on real problems is the best way to learn.
- If a task feels tedious and unrewarded, then restate what visualization or question it enables before continuing.
Analytic Productivity — decision rules
◆ All 5 checkpoints — included with this guide purchase
Cognitive Clarity — decision rules
◆ All 5 checkpoints — included with this guide purchase
Data Complexity and Messiness — decision rules
◆ All 5 checkpoints — included with this guide purchase
Code Duplication Reduction — decision rules
◆ All 6 checkpoints — included with this guide purchase
Insight Generation — decision rules
◆ All 5 checkpoints — included with this guide purchase
Integrated Toolkit Use — decision rules
◆ All 5 checkpoints — included with this guide purchase
Iterative Exploration Behavior — decision rules
◆ All 5 checkpoints — included with this guide purchase
Reproducible Communication Behavior — decision rules
◆ All 5 checkpoints — included with this guide purchase
Tidy Data Adoption — decision rules
◆ All 5 checkpoints — included with this guide purchase
Case studies — including what didn't work
Analyst Motivation
The book's own sequence is the example. A learner who starts with data ingest and tidying meets a subject that is 80% routine and boring and 20% weird and frustrating, and is likely to quit. The authors reverse the order. In Chapter 1 you load the tidyverse with one line, library(tidyverse), and build ggplot2 plots from data that is already imported and tidied. You see results immediately and understand the data better. Chapter 5 then adds your curiosity and skepticism to ask and answer interesting questions. When you later hit a one-character punctuation error while importing your own file, you have a concrete memory of what the tidy data will make possible. The book states the effect directly: your motivation will stay high because you know the pain is worth it. The frustration is still there, but it is typical and temporary.
Analytic Productivity
Take the flights-by-destination analysis. The naive version names every intermediate data frame: one for the grouping, one for the summary, one for the filter. Naming them slows you down even though you never reuse them. Rewrite it as one chain: delays <- flights %>% group_by(dest) %>% summarize(count = n(), dist = mean(distance, na.rm = TRUE), delay = mean(arr_delay, na.rm = TRUE)) %>% filter(count > 20, dest != "HNL"). It reads as group, then summarize, then filter. The filter drops noisy destinations with few flights and Honolulu, which is almost twice as far as the next closest airport. The na.rm = TRUE arguments matter too. Without them, grouping by year, month, and day returns NA for every mean of dep_delay, which is rework you avoid by handling missing values at the summarize step. Put the script in an RStudio project, save plots with relative paths such as ggsave("diamonds.pdf"), and restart and rerun with Cmd/Ctrl-Shift-F10 then Cmd/Ctrl-Shift-S. The whole analysis then regenerates from scratch and works on any collaborator's machine.
◆ What happened, and the outcome — included with this guide purchase
Cognitive Clarity
The source's flights example shows the shift in load. The first version creates `by_dest`, then `delay`, then overwrites `delay` with a filtered copy, so you must track three object names that you don't care about. The rewrite is `delays <- flights %>% group_by(dest) %>% summarize(count = n(), dist = mean(distance, na.rm = TRUE), delay = mean(arr_delay, na.rm = TRUE)) %>% filter(count > 20, dest != "HNL")`. It reads as three imperatives: group by destination, summarize distance, delay and count, then filter out noisy points (count of 20 or fewer) and Honolulu, which is almost twice as far away as the next closest airport. If you drop `na.rm = TRUE` from the `mean()` calls, you get `NA` for every group. That is the standard missing-value rule, not a bug in your logic. With the pipe and the explicit `na.rm`, your attention goes to the substantive finding: delay rises with distance up to about 750 miles and then falls. The question 'maybe longer flights make up delays in the air?' is then the only thing left to think about.
◆ What happened, and the outcome — included with this guide purchase
Data Complexity and Messiness
Take the params example from the list chapter. You want three random draws, each with a different mean, sd and n. Passing the arguments as loose lists is fragile because the order matters and the lengths can silently differ. Instead you build params <- tribble(~mean, ~sd, ~n, 5, 1, 1, 10, 5, 3, -3, 10, 5) and call params %>% pmap(rnorm). The data frame guarantees named columns of equal length, and the result is a list of three vectors of lengths 1, 3 and 5 (for example 4.68 for the first). You then raise the mess one more level: the function itself varies, so you add a tribble with columns f and params holding "runif" with list(min = -1, max = 1), "rnorm" with list(sd = 5), and "rpois" with list(lambda = 10). mutate(sim = invoke_map(f, params, n = 10)) stores the results in a list-column. The structure is now irregular (numeric and integer vectors, different arguments per row), yet it stays in one rectangular tibble. If you tried to unnest columns whose row lengths differ, as in df2 with y of length 1 and 2 and z of length 2 and 1, you would hit the 'same number of elements' error. That error is the signal that the data has outgrown a simple rectangle.
◆ What happened, and the outcome — included with this guide purchase
Code Duplication Reduction
The source starts with a rescaling formula copied for columns a, b, c and d, and one copy has an error: an a was never changed to a b. You count the inputs and find one, df$a, so you set x <- df$a. The formula computes min and max of x three times, so you replace that with rng <- range(x, na.rm = TRUE) and (x - rng[1]) / (rng[2] - rng[1]). The output still matches (0.289 0.751 0.000 ...), so you wrap it as rescale01 <- function(x) { ... }. rescale01(c(0, 5, 10)) returns 0.0 0.5 1.0, and c(1, 2, 3, NA, 5) returns 0.00 0.25 0.50 NA 1.00. Later, x <- c(1:10, Inf) makes rescale01() return NaN in the last position and 0 elsewhere. You change one line to range(x, na.rm = TRUE, finite = TRUE), and the result becomes 0.000 0.111 ... 1.000 Inf. The four calls to rescale01() pick up the fix automatically. The same logic applies in ggplot2: geom_point(aes(x = displ, y = hwy)) + geom_smooth(aes(x = displ, y = hwy)) repeats the mappings, so you move them into ggplot(data = mpg, mapping = aes(x = displ, y = hwy)). Switching hwy to cty then means editing one place.
◆ What happened, and the outcome — included with this guide purchase
Insight Generation
The source's baseball case. Using the Lahman package, you group Batting by playerID and compute ba = sum(H)/sum(AB) and ab = sum(AB). You then plot ab (x) against ba (y) for players with ab > 100, adding geom_point() and geom_smooth(). Two patterns appear. Scatter in ba is wide at low ab and narrows as ab grows, which is the effect of having more data points. There is also a positive trend between ab and ba, explained by teams controlling who plays and picking their best players. The naive check, arrange(desc(ba)), returns players such as abramge01 with ba = 1 and ab = 1, and the source calls these players clearly lucky, not skilled. The insight is not 'these players are the best'. It is that small samples produce extreme averages, and that opportunity is itself tied to skill. Ranking only becomes meaningful once you account for ab.
◆ What happened, and the outcome — included with this guide purchase
Integrated Toolkit Use
The readr challenge.csv example shows the toolkit's discipline at the import stage. You read it with read_csv(readr_example("challenge.csv")) and let readr guess. Column y comes back as <chr> because the default guess looks at only the first 1000 rows, and those rows give no evidence it is a date. The fix is to state the types: col_types = cols(x = col_double(), y = col_date()). The tail then shows y as <date>, with values like 2019-11-21. A second route, guess_max = 1001, works because one more row is enough for readr to parse correctly. The authors still recommend always supplying col_types. If you rely on the defaults and the data changes, readr keeps reading it in without complaint. When you want a hard stop, stop_for_problems() throws an error on any parsing problem. For diagnosis you can read everything as character with .default = col_character() and apply type_convert(). The result is a typed tibble that flows straight into dplyr and ggplot2 with no ad hoc cleanup.
◆ What happened, and the outcome — included with this guide purchase
Iterative Exploration Behavior
Start with the question: how are the values of `y` in `diamonds` distributed? You draw `geom_histogram(mapping = aes(x = y), binwidth = 0.5)`. The only evidence of a problem is unusually wide y-axis limits, because the common bins are so tall that the rare bins are invisible. You refine the view by adding `coord_cartesian(ylim = c(0, 50))`. Now three unusual values show up: 0, ~30, and ~60. That is a lead, and it prompts a new question: are these data-entry errors or something real? Elsewhere, you ask whether cancelled flights depart at different times. You build `cancelled = is.na(dep_time)` and rescale `sched_dep_time`, then draw a `geom_freqpoly` coloured by `cancelled`. The plot is weak because non-cancelled flights vastly outnumber cancelled ones, so you note the problem and move to a density-based comparison. Each pass turns one plot into a better question.
◆ What happened, and the outcome — included with this guide purchase
Reproducible Communication Behavior
You get stuck on a problem in a dataset and want help. Following the source's reprex procedure, you open a new script and put library(tidyverse) at the top, then run tidyverse_update() to confirm your packages are current. You run dput(mtcars), copy the output, and in the script type mtcars <- followed by the paste. You then look for the smallest subset of rows and columns that still reproduces the problem, and delete every line unrelated to it. You add a comment at the line where the problem occurs and check that spacing and variable names are tidy. Last, you start a fresh R session and paste in the whole script. If it fails or behaves differently, the example was not reproducible and you fix it. The source adds that in the course of making a reprex you often figure out the problem yourself.
◆ What happened, and the outcome — included with this guide purchase
Tidy Data Adoption
The passages' challenge.csv import shows the principle at the column level. Read with default guesses, the tail of the file shows y as <chr>, with values like 2019-11-21 and 2018-03-29 stored as text. The data holds one variable, a date, but the storage says character, so the structure does not match the semantics. The fix is to state the semantics in code: read_csv(readr_example("challenge.csv"), col_types = cols(x = col_double(), y = col_date())). The tail now prints x as <dbl> and y as <date>. The same data is now stored as two typed variables, one per column, with one observation per row. The text says to always supply col_types because, if you rely on guesses and the data changes, readr keeps reading it in anyway. Adding stop_for_problems() makes the script stop on any parsing problem. The row-equals-observation rule then pays off downstream: nrow(diamonds) returns 53940 because each row is one diamond, and nrow(diamonds) - nrow(smaller) gives 126 diamonds over 2.5 carats with no reshaping. Likewise broom::augment(model, data) returns one row per row of data, adding residuals and influence statistics.
◆ What happened, and the outcome — included with this guide purchase
Templates
Payoff-Before-Pain Motivation Card
Analysis Project Readiness Checklist
◆ The fillable template — included with this guide purchase
Clarity Pass Checklist for an Analysis Script
◆ The fillable template — included with this guide purchase
Messiness Triage Card
◆ The fillable template — included with this guide purchase
DRY Extraction Checklist
◆ The fillable template — included with this guide purchase
Insight Audit Sheet
◆ The fillable template — included with this guide purchase
Tidyverse Pipeline Audit Sheet
◆ The fillable template — included with this guide purchase
EDA Loop Log
◆ The fillable template — included with this guide purchase
Tidy Data Shape Check
◆ The fillable template — included with this guide purchase
Items marked Paid are included when you buy this guide.
Movement IV
Reflect
Consider the book's evidence, limitations and how it compares with other sources.
How good is it — where the book stands against the field, what it leaves open, and when to trust it.
- — Its positioning, its critique, its blind spots
- — When to apply it — and when not
- — The evidence behind the advice
Book profile · in the corpus
This book’s model, against the corpus
5 of 10 constructs align with the field · 5 the book adds · 2 where it diverges · the field spans 24 constructs across 5 books
Shared with the corpus — corroborated by other sources
This book's own emphasis — where it's the authority
Where it diverges — the book and the field pull apart
The corpus adds — from 4 other sources this book doesn't cover
The full field guide folds in ideas this book doesn’t reach — drawn from 4 further sources and cited in the full model.
This book’s place in the corpus
Why the corpus guide, not just this book
The book stands on the shoulders of data-analysis and programming-craft traditions (tidy data, DRY, literate programming) and is the authority on tidy-data conventions, the tidyverse, and exploratory analytic workflow. The reconciled field-guide still adds the human and organizational layer (motivation, coordination, leadership, delivery outcomes) that determines whether these individual practices scale to teams.
This guide stands on the shoulders of this book and 4 other sources — every claim cited, the disagreements named.
Read the reconciled Lead A Hardware Engineering Team guide →
Read it closely
The book, examined
Not a summary — a close analytical reading: how the book is built, what it leaves open, and where it falls short.
How it’s built — the argument in order
- 01Introduction: the data science workflow — Frames data science as a cycle of import, tidy, transform, visualize, model and communicate, surrounded by programming. It explicitly scopes the book to the 'important 80%' (rectangular, in-memory data, hypothesis generation) and argues for starting with visualization and transformation to keep motivation high.
- 02Explore: visualization, transformation, EDA (ggplot2, dplyr) — Starts with clean data so readers get quick wins. Introduces the grammar of graphics (data, geoms, aesthetics, stats, positions, coordinates, facets) and dplyr's verbs (filter, arrange, select, mutate, summarize, group_by). Frames exploratory data analysis as iterative questioning of variation and covariation.
- 03Wrangle: tibbles, import, tidy data, relational data, strings, factors, dates — Addresses the 'boring' ingest and cleaning work once the payoff is understood. Defines tidy data by three interrelated rules (variable = column, observation = row, value = cell) with the Tolstoy-style claim that tidy datasets are alike while messy ones differ. Argues that a consistent structure makes tools easier to learn and lets vectorization work. Adds tools for joining tables and handling strings, factors and lubridate dates/times (with the warning to use the simplest data type that works).
- 04Program: pipes, functions, vectors, iteration — Presents programming as a way to reduce duplication. Gives the 'copy-paste more than twice' rule for writing a function, with three advantages: evocative names, a single place to update, and no incidental copy-paste errors (the rescaling example contains one). Covers vectors, for loops and purrr's map functions, and notes that style matters and consistency is the key.
- 05Model: models as pattern/residual partitioning (modelr) — Treats models as exploration tools rather than confirmatory machinery. A model captures a pattern, the residuals are what remains, and repeated modelling peels back layers of structure. Covers model building and many-models workflows with list-columns, and includes a caution about preregistering the analysis plan for confirmatory work.
- 06Communicate: R Markdown, graphics for communication, formats, workflow — Shows how to turn analysis into reproducible documents that weave prose, code and results together for decision makers and collaborators. Also covers plots tuned for communication and pointers to further resources for the remaining 20% (e.g., other file types for import such as JSON/XML).
What it leaves unsolved
How should analysts handle data that is not rectangular or does not fit in memory (hierarchical JSON/XML, very large data)?
The book deliberately limits itself to rectangular, in-memory data and only points to jennybc's purrr tutorials, xml2/jsonlite, and external manuals for other formats, leaving the 'other 20%' unaddressed.
How do you move from exploratory hypothesis generation to rigorous confirmation?
The authors state that hypothesis confirmation needs preregistration and a fixed plan, and defer the topic ('we'll talk a little a[bout]...'), so the book does not teach inference, held-out testing or how to avoid overfitting to the data you explored.
What is the full set of rules for correct time handling (leap years, DST, leap seconds, time zones)?
The dates chapter admits it will not teach 'every last detail' and gives practical grounding only; R also lacks a native time-of-day class, which is pushed to the hms package.
How do you deal with the many ways a dataset can be messy?
The 'every messy dataset is messy in its own way' line concedes there is no single recipe; the book gives a tidy target and some tools but no general method for diagnosing a new mess, and the underlying theory is relegated to the separate Tidy Data paper.
How does the workflow scale from individual analysis to team and production settings?
Writing good functions is called 'a lifetime journey' and only a pragmatic starting point is offered. Style is said to be a matter of consistency, with no guidance on testing, packaging or collaboration at scale.
Where it falls short — a fair critique
The scope is intentionally limited to the 'important 80%': rectangular, in-memory data and exploratory analysis. Big data, databases, non-rectangular formats, and production deployment are left to pointers. This is honest but leaves practitioners with real gaps, and the 80% figure is asserted rather than evidenced.
The modelling and statistical treatment is thin. Models are framed as exploration devices (pattern plus residual), with little on uncertainty, inference, validation or prediction. The confirmatory side is deferred to preregistration and other resources, so readers may over-trust exploratory findings.
The claim that tidy data is the one representation that is 'much easier to work with' is overgeneralized. The wide format (e.g., table4 with year columns) is often better for matrix operations, display, or some modelling tasks. The text treats tidiness as best because the tidyverse is built around it, which is partly circular, though it does give concrete reasons (uniformity, vectorization).
The claim that the three tidy rules are 'interrelated because it's impossible to only satisfy two of the three' is asserted without proof and then reduced to two practical instructions. The reduction is useful pedagogically but not rigorous, and several cases (e.g., deciding what counts as a variable or observation) remain judgment calls the rules cannot settle.
The pedagogical claim that starting with visualization and clean data sustains motivation is stated as a design choice with no evidence from learners. The 'copy-paste more than twice' threshold and the preference for tidyverse idioms over base R are likewise presented as authority-based convention and reflect the authors' own ecosystem, so the book is opinionated and gives limited comparison with alternatives.
Reproducibility is covered mainly through R Markdown. Environment and package versioning, data provenance and collaboration practices that keep results reproducible over time are not treated; the book also depends on a fast-moving package ecosystem, so examples can date quickly.
Before you apply it
Using it well
Where the method fits, who it’s for, and the honest case for and against — so you apply it where it works.
Is this book for you?
For you if
- You are new to R, or to programming, and want an opinionated, coherent toolkit for data analysis
- You want to move from raw data to plots, summaries and reports quickly
- You do exploratory work on tabular data, such as analysts, scientists and students
- You want a mental model of the whole data science workflow, not isolated functions
Skip it if
- You need deep statistical theory or formal inference; the book only points to other resources
- Your work is mostly big data, deep learning or production engineering
- You are already fluent in the tidyverse and only need reference documentation
- You work mainly in Python and have no need for R
Need first
- R and RStudio installed, plus the tidyverse and the practice-data packages (e.g. nycflights13)
- Willingness to type and run code while reading, since the book is hands-on
- Basic comfort with vectors and function calls, which the book builds up as it goes
- Basic numeracy; no advanced statistics is required to start
When it applies — and when it doesn’t
- Exploratory analysis of rectangular, in-memory datasets (surveys, logs, experiments, business tables) — this is the book's stated 80% sweet spot, and the tidyverse tools are built for it
- Reshaping messy tables into one-variable-per-column form before plotting or modeling — tidy data lets dplyr and ggplot2 work together with little friction, and the upfront work pays off later
- Repeating the same code block three or more times across columns or datasets — the book says to write a function once you have copied a block more than twice, which avoids incidental copy-paste errors
- Communicating results to decision makers or collaborators in a reproducible document — R Markdown keeps prose, code and output together, so reports can be regenerated
- Working with dates and times (flight data, time zones, DST) — lubridate helps, but the book only gives a practical grounding; leap years, DST and leap seconds still need care, and you should use the simplest type that works
- Confirmatory or preregistered hypothesis testing — the book focuses on hypothesis generation and exploration; confirmatory work needs a preregistered plan that you do not deviate from after seeing the data
- Using models to explore structure by splitting data into patterns and residuals — models are framed as exploration tools, not formal inference or predictive-accuracy machinery, so treat the findings as hypotheses
- Non-rectangular sources like JSON, XML or hierarchical data — the book only points to other packages (jsonlite, xml2) and tutorials, so expect extra learning
- Big data that does not fit in memory or needs distributed computing — the book scopes itself to in-memory data and points elsewhere for the remaining 20%
- Production machine-learning pipelines and deployment — the workflow targets understanding and insight, not engineering for production systems
- Teams standardized on Python or another language stack — the book teaches R and tidyverse idioms specifically, so they transfer only conceptually
The honest case
Strongest case for
- One consistent data structure (tidy data) means tools share a design, so they are easier to learn and compose, and less time goes to reshaping data
- Starting with visualization and transformation on clean data keeps learners motivated before the harder wrangling chapters
- The grammar of graphics and the five dplyr verbs give small, general building blocks that cover most everyday tasks
- Treating functions, iteration and R Markdown as core skills reduces duplication errors and makes analyses reproducible
- The authors state their scope openly (the 80%) and point to resources for the rest, so they do not oversell
Strongest objection
- The tidyverse is opinionated and sits on top of base R, so learners may struggle with base R code and other people's non-tidy code
- Tidy, in-memory, rectangular data is a narrow slice; real problems involve large, nested or streaming data, where the approach gives less help
- Emphasizing exploration and hypothesis generation can encourage data dredging unless you also preregister and separate confirmatory work
- Teaching visualization before cleaning may understate how much of real projects is messy data, and models-as-exploration gives thin coverage of inference and prediction
- Package APIs change over time, so book code can go stale and tie the learner to one ecosystem
The model's constructs are drawn from the source element(s); load-bearing constructs are corroborated across the shelf, emerging ones are flagged.
Ideas covered by the source notes
- Tidy Data Adoption
- Integrated Toolkit Use
- Code Duplication Reduction
- Analyst Motivation
- Cognitive Clarity
- Iterative Exploration Behavior
Movement V
Measure
Use available assessments to reflect on what you have learned.
A way to gauge yourself against the book's model, and the instruments it gives you.
- — A self-check built from the book
- — Instruments and what you'd measure next
Learning curriculum
After this book, you can…
The book's learning objectives, classified by Bloom's taxonomy and ordered so each builds on the ones before it.
- describeAfter this book you can describe the data science workflow (import, tidy, transform, visualize, model, communicate, surrounded by programming) and explain where each tidyverse tool fits within it.Check: Short-answer or diagram task: given a project scenario, map each step to a workflow stage and name the appropriate tidyverse package.
- explainAfter this book you can explain why an exploration-first, 80/20 approach (starting with visualization and transformation of clean data) sustains motivation, and apply the 'master one toolkit deeply' principle when planning your own learning.Check: Reflective written response describing a personal learning plan that prioritizes early payoff and a focused toolset, with justification drawn from the book's principles.
- constructAfter this book you can build plots with ggplot2 by specifying data, geoms, aesthetic mappings, stats, position adjustments, coordinate systems, and facets according to the grammar of graphics.Check: Practical coding exercise: reproduce a target plot and then modify it (add facets, change geom or coordinate system) using a provided dataset.
- applyAfter this book you can transform data frames with dplyr's filter, arrange, select, mutate, summarize, and group_by, combining them with the pipe to answer specific questions.Check: Coding tasks on nycflights13: write piped pipelines to answer questions such as average delay by carrier or ranking of destinations.
- conductAfter this book you can run an exploratory data analysis cycle by generating questions, visualizing and transforming data, and refining the questions, looking at variation and covariation to find real patterns.Check: Open-ended EDA project on an unfamiliar dataset; submit a log of the questions asked, the plots and transformations used, and how each question was refined.
- writeAfter this book you can write functions and use iteration (for loops and purrr map functions) to remove duplicated code, following the rule of never copying and pasting more than twice.Check: Refactoring task: given a script with copy-pasted blocks, extract functions with clear names and replace repetition with a for loop or map call, then test that the output is unchanged.
- transformAfter this book you can import rectangular data with readr and reshape messy data into tidy tibbles using tidyr (pivoting, separating, handling missing values) and relational joins.Check: Practical wrangling exercise: import a raw file, tidy it, join it with a second table, and verify that the result satisfies the tidy rules.
- fit and interpretAfter this book you can fit simple models (linear models, with visualized predictions) that partition data into patterns and residuals, and use them to peel back layers of structure in a dataset.Check: Modeling exercise: fit a model to a dataset such as diamonds, plot the residuals, and explain what pattern the model captured and what remains.
- select and useAfter this book you can work with specialized data types (strings and regular expressions, factors, dates and times) by choosing the simplest data type or structure that solves the problem.Check: Coding exercises using stringr, forcats, and lubridate (such as parsing dates, handling time zones, and recoding factor levels), with a justification of each data type choice.
- diagnoseAfter this book you can identify whether a dataset is tidy using the three rules (variables in columns, observations in rows, values in cells) and diagnose how a messy dataset violates them.Check: Given several representations of the same data (like table1 to table4), identify which is tidy, state which rule each other table breaks, and explain why tidy form suits vectorized tidyverse tools.
- createAfter this book you can create reproducible R Markdown documents that combine prose, code, and results to communicate findings and reasoning to decision makers and collaborators.Check: Deliverable: an R Markdown report that knits from scratch, with narrative, figures, and documented reasoning, graded on reproducibility and clarity for a non-technical audience.
- integrateAfter this book you can plan and carry out a complete end-to-end analysis, from import to communication, by combining tidy data practices, the tidyverse toolkit, functions and iteration, modeling, and reproducible reporting while adapting to how messy or large the data is.Check: Capstone project on a new, messy dataset: submit a reproducible report and code, evaluated on tidiness, code quality, exploration depth, modeling, and communication.
- critiqueAfter this book you can evaluate and rewrite code for readability by choosing evocative names, using the right vector or list structures, and treating code as communication for humans.Check: Code review exercise: critique a poorly written script and submit a rewritten version, with comments explaining each improvement.
- judgeAfter this book you can distinguish exploration from confirmation by judging whether an observation has already been used for exploration, so that you do not mistake chance patterns for true relationships.Check: Case-based questions: decide whether a described analysis is exploratory or confirmatory, and critique its use of data (for example, a hypothesis tested on the same data that generated it).
How to measure it
Turning each idea into a measure
For each construct: how to operationalize it, the observable signals to look for, and how well it holds up.
Assessed by inspecting datasets/code for tidy structure (one variable per column, one observation per row) and by self-reported consistency of tidying practice.
- datasets stored as tibbles with tidy layout
- frequency of using gather()/spread()/separate()
- absence of values embedded in column names
Could be scored as a proportion of datasets in a workflow that meet tidy criteria; feasibility only, no scoring rules prescribed.
Archival code inspection gives objective evidence; self-report risks social desirability about 'good practice'. · High inter-rater reliability expected given clear tidy criteria.
Measured by the proportion of analysis tasks performed with tidyverse packages (ggplot2, dplyr, tidyr, readr, purrr) versus inconsistent alternatives, observable in scripts and self-report.
- library(tidyverse) calls
- use of %>% pipelines
- consistent verb-based function usage
Feasible to count tidyverse function calls relative to total; self-report of toolkit preference also feasible.
Code-based measurement is objective and valid; self-report adequate for preference. · High reliability from automated code parsing.
Assessed by analyzing code for repeated blocks versus abstracted functions and map/loop usage that consolidate repetition.
- defined custom functions
- absence of near-duplicate code blocks
- use of purrr map functions
Feasible via static code analysis counting duplicated lines and function definitions; no scoring rules prescribed.
Archival code analysis is the most valid mode; self-report is weaker. · Reasonably reliable with consistent code-analysis criteria.
Captured via self-reported engagement, persistence intentions, and frustration levels during analysis tasks.
- self-rated motivation
- continued practice over time
- completion of exercises
Perceptual self-report feasible; behavioral proxies like session continuation possible.
Self-report valid for subjective motivation but prone to recall and desirability bias. · Moderate; motivation fluctuates over time.
Measured by self-reported ease of focusing on questions and, indirectly, by ratio of time spent on analysis versus wrangling.
- self-rated clarity/focus
- proportion of session time on substantive analysis
- fewer reported tool-related interruptions
Perceptual self-report plus time-allocation proxies feasible.
Subjective construct; triangulation with time-tracking improves validity. · Moderate; depends on task and individual.
Observed via the count and cadence of plots, transformations, and model fits performed in an analysis session.
- number of distinct plots produced
- number of data transformations
- number of candidate models fit
Behavioral logs of analysis actions feasible; no scoring rules prescribed.
Behavioral measurement objective but may not capture quality of exploration. · Reliable if action logging is consistent.
Assessed by existence and completeness of R Markdown notebooks/reports and accompanying documentation of reasoning.
- .Rmd files that knit successfully
- narrative explanations alongside code
- version tracking of dependencies
Archival artifact analysis feasible; self-report of documentation habits possible.
Artifact-based measurement valid; quality of communication harder to quantify. · Reliable for presence/absence; less so for quality.
Proxied by the number and validity of hypotheses generated and patterns identified, judged by domain experts.
- documented findings/hypotheses
- expert-rated quality of insights
- patterns confirmed in independent data
Mixed-mode; expert judgment plus counts of validated hypotheses feasible.
Hard to measure directly; expert ratings improve validity but introduce subjectivity. · Lower; insight quality is judgment-dependent.
Proxied by time-to-completion, error rates, and breadth of problems solved per unit effort, plus self-report.
- time per analysis task
- number of debugging incidents
- range of project types handled
Mixed-mode; behavioral timing and error logs plus self-report feasible.
Productivity proxies valid but context-dependent. · Moderate; depends on consistent task definition.
Measured by dataset size (e.g., MB/GB), proportion of missing/inconsistent values, and degree of non-rectangular structure.
- file size and row count
- percent missing values
- presence of images/text/trees vs. tables
Archival measurement of dataset properties feasible.
Objective archival metrics give high validity for size and missingness. · High for size; moderate for structural irregularity classification.
Self-assessment
Where would you like to improve?
This is a structured self-diagnostic built from the model — a mirror for reflection, not a validated psychometric scale. For validated measurement, see the instruments below.
1 = Strongly Disagree · 7 = Strongly Agree
Proposed measures — starter instruments where no validated one was found
Tidy Data Adoption Practice Index (Proposed)
proposed · not validatedRated for your team or hiring process — not a personal self-check.
- Analytical datasets in the project's shared repository are structured so that each variable is a single column, each observation is a single row, and each value occupies its own cell.
- A documented data-structure standard or schema exists, and incoming datasets are reshaped to it (for example, wide-to-long) before analysis begins.
- Code reviews or automated checks flag datasets with multiple variables in one column, values stored in column names, or multiple observation types in one table.
Scale: 1–7 (Strongly Disagree → Strongly Agree), rated by an evaluator or the team. Average the items; treat ≤3 as a gap to close in the process.
Integrated Toolkit Use Index (Proposed)
proposed · not validatedRated for your team or hiring process — not a personal self-check.
- The team's written analysis guidelines name a core, consistent set of packages (such as readr, dplyr, tidyr, purrr, and ggplot2) as the default for import, transformation, iteration, and visualization.
- Analysis scripts in the repository pass data between steps in a consistent function-chaining style (such as pipes) rather than mixing incompatible idioms within the same workflow.
- Use of tools outside the core set is accompanied by a documented rationale or a conversion step so that outputs remain compatible with the core toolkit.
Scale: 1–7 (Strongly Disagree → Strongly Agree), rated by an evaluator or the team. Average the items; treat ≤3 as a gap to close in the process.
Code Duplication Reduction Index (Proposed)
proposed · not validatedRated for your team or hiring process — not a personal self-check.
- Repeated logic in the codebase is extracted into named, documented functions that are reused rather than copied and pasted.
- Repetitive operations across columns, files, or groups are implemented with iteration tools (such as map functions or loops) instead of duplicated blocks of code.
- Code review checklists or automated duplication checks include a step that identifies copy-pasted code, and flagged duplicates are refactored before merging.
Scale: 1–7 (Strongly Disagree → Strongly Agree), rated by an evaluator or the team. Average the items; treat ≤3 as a gap to close in the process.
Sources
- R for Data Science — Hadley Wickham · A practical, hands-on guide to doing data science in R using the tidyverse, walking the reader through the complete workflow of importing, tidying, transforming, visualizing, modeling, and communicating data.
The cheat sheet
Everything, on one page
One key takeaway from each section, with links to read more.
- Tidy Data AdoptionDefine the observation first; tidiness follows from that choice, not from a table's shape.
- Integrated Toolkit UseConsistency across packages is the benefit; no single package delivers it alone.
- Code Duplication ReductionThree copies is the trigger for extracting a function.
- Analyst MotivationPut a visualization early in the workflow to earn the patience tedious steps require.
- Cognitive ClarityClarity comes from structure, consistency, and naming, and all three are within your control.
- Iterative Exploration BehaviorSpeed of the question-plot-refine loop determines how many leads you generate.
- Reproducible Communication BehaviorDo the analysis in the document so reasoning is captured at the moment you have it.
- Insight GenerationA pattern becomes an insight only after it survives checks for chance and confounding.
- Analytic ProductivityFewer errors and less rework drive productivity more than raw coding speed.
- Data Complexity and MessinessAssess complexity up front to predict how much reshaping work lies ahead.
Publication details
Consult the sources listed in this guide for further reading. Edition 1 · Updated 2026-10-03.