Package: tidytable

Mark Fairbanks

tidytable: Tidy Interface to 'data.table'

A tidy interface to 'data.table', giving users the speed of 'data.table' while using tidyverse-like syntax.

Authors:Mark Fairbanks [aut, cre], Abdessabour Moutik [ctb], Matt Carlson [ctb], Ivan Leung [ctb], Ross Kennedy [ctb], Robert On [ctb], Alexander Sevostianov [ctb], Koen ter Berg [ctb]

tidytable.pdf |tidytable.html
tidytable/json (API)

# Install tidytable in R:
install.packages('tidytable', repos = c('', ''))

Peer review:

Bug tracker:


165 exports 437 stars 7.35 score 12 dependencies 13 dependents 3.1k downloads

Last updated 2 months agofrom:e10cf3b60c360231c71baf058d4397f5c9a5b219



Readme and manuals

Help Manual

Help pageTopics
Fast '%in%' and %notin% operators%in% %notin%
Apply a function across a selection of columnsacross
Add a count column to the data frameadd_count add_tally
Arrange/reorder rowsarrange
Coerce an object to a data.table/tidytableas_tidytable
Do the values from x fall between the left and right bounds?between
Bind data.tables by row and columnbind_cols bind_rows
Combine values from multiple columnsc_across
'data.table::fcase()' with vectorized defaultcase
Vectorized 'switch()'case_match
Case whencase_when
Coalesce missing valuescoalesce
Complete a data.table with missing combinations of datacomplete
Generate a unique id for consecutive valuesconsecutive_id
Context functionscontext cur_column cur_data cur_group_id cur_group_rows
Count observations by groupcount tally
Cross joincross_join
Create a data.table from all unique combinations of inputscrossing
Descending orderdesc
Select distinct/unique rowsdistinct
Drop rows containing missing valuesdrop_na
Pipeable data.table calldt
Convert a vector to a data.table/tidytableenframe
Expand a data.table to use all combinations of valuesexpand nesting
Create a data.table from all combinations of inputsexpand_grid
Extract a character column into multiple columns using regexextract
Fill in missing values with previous or next valuefill
Filter rows on one or more conditionsfilter
Extract the first, last, or nth value from a vectorfirst last nth
Read/write filesfread
Convert character and factor columns to dummy variablesget_dummies
Groupinggroup_by ungroup
Selection helper for grouping columnsgroup_cols
Split data frame by groupsgroup_split
Get the grouping variablesgroup_vars
Create conditions on a selection of columnsif_all if_any
Fast if_elseif_else
Run invisible garbage collectioninv_gc
Check if the tidytable is groupedis_grouped_df
Test if the object is a tidytableis_tidytable
Get lagging or leading valueslag lead
Join two data.tables togetheranti_join full_join inner_join left_join right_join semi_join
Apply a function to each element of a vector or listmap map2 map2_chr map2_dbl map2_df map2_dfc map2_dfr map2_int map2_lgl map2_vec map_chr map_dbl map_df map_dfc map_dfr map_int map_lgl map_vec pmap pmap_chr pmap_dbl pmap_df pmap_dfc pmap_dfr pmap_int pmap_lgl pmap_vec walk
Add/modify/delete columnsmutate
Add/modify columns by rowmutate_rowwise
Number of observations in each groupn
Count the number of unique values in a vectorn_distinct
Convert values to 'NA'na_if
Nest columns into a list-columnnest
Nest data.tablesnest_by
Nest joinnest_join
Create a tidytable from a listnew_tidytable
Selection version of 'across()'pick
Pivot data from wide to longpivot_longer
Pivot data from long to widepivot_wider
Pull out a single variablepull
Reframe a data framereframe
Relocate a column to a new positionrelocate
Rename variables by namerename
Rename multiple columnsrename_with
Replace missing valuesreplace_na
Ranking functionscume_dist dense_rank min_rank percent_rank row_number
Convert to a rowwise tidytablerowwise
Select or drop columnsselect
Separate a character column into multiple columnsseparate
Split a string into rowsseparate_longer_delim
Separate a collapsed column into multiple rowsseparate_rows
Separate a character column into multiple columnsseparate_wider_delim
Separate a character column into multiple columns using regex patternsseparate_wider_regex
Choose rows in a data.tableslice slice_head slice_max slice_min slice_sample slice_tail
Aggregate data using summary statisticssummarise summarize
Build a data.table/tidytabletidytable
Select top (or bottom) n rows (by value)top_n
Add new variables and drop all otherstransmute
Rowwise tidytable creationtribble
Uncount a data.tableuncount
Unite multiple columns by pasting strings togetherunite
Unnest list-columnsunnest
Unnest a list-column of vectors into regular columnsunnest_longer
Unnest a list-column of vectors into a wide data frameunnest_wider