The goal of tidyr is to help you create tidy data. Tidy data is data where:
Tidy data describes a standard way of storing data that is used wherever possible throughout the tidyverse. If you ensure that your data is tidy, you’ll spend less time fighting with the tools and more time working on your analysis.
There are two fundamental verbs of data tidying:
gather() takes multiple columns, and gathers them into key-value pairs: it makes “wide” data longer.
spread() takes two columns (key & value), and spreads into multiple columns: it makes “long” data wider.
To get started, read the tidy data vignette (
vignette("tidy-data")) and check out the demos (
demo(package = "tidyr")).
Please note that the tidyr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.