Skip to content

tidyr

Reference of datar.dplyr

Reference map of r-tidyverse-tidyr can be found here.

Legend:

Sample Status
normal API that is regularly ported
strike-through API that is not ported, or not an API originally
bold API that is unique in datar
italic Working in process

Pivoting

API Description Notebook example
pivot_longer() Pivot data from wide to long
pivot_wider() Pivot data from long to wide

Rectangling

API Description Notebook example
hoist() unnest_longer() unnest_wider() unnest_auto() Rectangle a nested list into a tidy tibble

Nesting

API Description Notebook example
nest() unnest() Nest and unnest

Character vectors

API Description Notebook example
extract() Extract a character column into multiple columns using regular expression groups
separate() Separate a character column into multiple columns with a regular expression or numeric locations
separate_rows() Separate a collapsed column into multiple rows
unite() Unite multiple columns into one by pasting strings together

Missing values

API Description Notebook example
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 possible combinations of values
expand_grid()
fill() Fill in missing values with previous or next value
full_seq() Create the full sequence of values in a vector
replace_na() Replace NAs with specified values

Miscellanea

API Description Notebook example
chop() unchop() Chop and unchop
pack() unpack() Pack and unpack
uncount() "Uncount" a data frame

Data

See datasets