Start studying
Module 1 · Data Basics Module contents
Module 1  ·  Card 14 / 14intermediate

Tidy Data

Tidy data is a standardised tabular structure where each variable is a column and each observation is a row.

In a tidy dataset, every measurement of a different attribute forms its own separate column.

Every separate observational unit forms its own distinct table, preventing duplicate information.

For example, recording patient blood pressure over three visits uses three separate rows, not three visit columns.

Structuring data tidily makes filtering, plotting, and statistical modelling straightforward and consistent.

Learn in depth ↓
Module 01 · Data Basics · 14 concepts
In depth  /  15 lines

Tidy Data, in more detail

The tidy data standard was formalised by statistician Hadley Wickham to streamline data analysis.

Datasets in the wild are messy in countless unique ways, requiring custom code for every operation.

Tidy datasets share a single consistent geometry that analytical tools are built to expect.

Rule one: each variable must have its own column.

Rule two: each observation must have its own row.

Rule three: each type of observational unit must form its own distinct table.

A common untidy pattern puts column names that are actually values across the top of a table.

For example, placing years like 2021, 2022, and 2023 as column headers treats values as variable names.

In tidy format, there would be a single year column and a single revenue column.

Untidy tables often resemble presentation spreadsheets formatted for human eyes rather than computers.

While wide layout tables are convenient for quick reading, they break automated charting tools.

Plotting libraries expect to map one aesthetic element like the horizontal axis to one named column.

Transforming untidy data into tidy format involves pivoting and melting operations.

Once data is tidy, analysts spend far less time reshaping tables and far more time exploring patterns.

Tidy structure creates an orderly pipeline from raw messy inputs to clean reproducible insights.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
A spreadsheet lists four years as column headers: 2021, 2022, 2023, and 2024. How does tidy data restructure this?
Data Basics

14 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close