Tidying

extract()

Extract one column into multiple columns.

gather()

Gather columns into key-value pairs.

nest()

Nest repeated values in a list-variable.

separate()

Separate one column into multiple columns.

separate_rows()

Separate a collapsed column into multiple rows.

spread()

Spread a key-value pair across multiple columns.

uncount()

"Uncount" a data frame

unite()

Unite multiple columns into one.

unnest()

Unnest a list column.

Implicit and explicit missing values

complete()

Complete a data frame with missing combinations of data.

drop_na()

Drop rows containing missing values

expand() crossing() nesting()

Expand data frame to include all combinations of values

fill()

Fill in missing values.

full_seq()

Create the full sequence of values in a vector.

replace_na()

Replace missing values

Data

smiths

Some data about the Smith family.

table1 table2 table3 table4a table4b table5

Example tabular representations

who population

World Health Organization TB data