Session 6
2026-03-25
See Tidy data vignette or the Tidy data paper by Hadley Wickham (2014) for more details.
Tidying data often requires you to use packages focused on different types of data:
There are also specialized packages that can help:
There are also non-R tools that can be helpful:
Categories of tidyr functions:
| City | 2000 | 2010 | 2020 |
|---|---|---|---|
| Baltimore city, Maryland | 300000 | 290000 | 285000 |
| Washington, DC | 300000 | 315000 | 330000 |
| Richmond, Virginia | 200000 | 202000 | 210000 |
| City | Year | Value |
|---|---|---|
| Baltimore city, Maryland | 2000 | 300000 |
| Baltimore city, Maryland | 2010 | 290000 |
| Baltimore city, Maryland | 2020 | 285000 |
…
| City name | 2000 | 2010 | 2020 |
|---|---|---|---|
| Baltimore city, Maryland | 300000 | 290000 | 285000 |
| Washington, DC | 300000 | 315000 | 330000 |
| Richmond, Virginia | 200000 | 202000 | 210000 |
| City | State | Year | Value |
|---|---|---|---|
| Baltimore city | Maryland | 2000 | 300000 |
| Washington | DC | 2000 | 300000 |
| Richmond | Virginia | 2000 | 200000 |
…
