tidyr
v0.8.1

Easily Tidy Data with 'spread()' and 'gather()' Functions

An evolution of 'reshape2'. It's designed specifically for data
tidying (not general reshaping or aggregating) and works well with
'dplyr' data pipelines.

Readme

tidyr

Overview

The goal of tidyr is to help you create tidy data. Tidy data is data
where:

Each variable is in a column.

Each observation is a row.

Each value is a cell.

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 timing fighting with the tools
and more time working on your analysis.

Installation

# The easiest way to get tidyr is to install the whole tidyverse:
install.packages("tidyverse")
# Alternatively, install just tidyr:
install.packages("tidyr")
# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("tidyverse/tidyr")

tidyr also provides separate() and extract() functions which makes
it easier to pull apart a column that represents multiple variables. The
complement to separate() is unite().

To get started, read the tidy data vignette (vignette("tidy-data"))
and check out the demos, demo(package = "tidyr")).

Related work

tidyr replaces reshape2 (2010-2014) and reshape (2005-2010). Somewhat
counterintuitively each iteration of the package has done less. tidyr is
designed specifically for tidying data, not general reshaping
(reshape2), or the general aggregation (reshape).

If you’d like to read more about data reshaping from a CS perspective,
I’d recommend the following three papers: