tidytable helpers

dt()

Pipeable data.table call

`%in%` `%notin%`

Fast %in% and %notin% operators

dplyr

Core dplyr verbs

arrange()

Arrange/reorder rows

filter()

Filter rows on one or more conditions

mutate()

Add/modify/delete columns

select()

Select or drop columns

summarize() summarise()

Aggregate data using summary statistics

Other dplyr functions

across()

Apply a function across a selection of columns

add_count() add_tally()

Add a count column to the data frame

between()

Do the values from x fall between the left and right bounds?

bind_cols() bind_rows()

Bind data.tables by row and column

c_across()

Combine values from multiple columns

case_match()

Vectorized switch()

case_when()

Case when

coalesce()

Coalesce missing values

consecutive_id()

Generate a unique id for consecutive values

count() tally()

Count observations by group

cur_column() cur_data() cur_group_id() cur_group_rows()

Context functions

cross_join()

Cross join

desc()

Descending order

distinct()

Select distinct/unique rows

enframe()

Convert a vector to a data.table/tidytable

group_by() ungroup()

Grouping

group_cols()

Selection helper for grouping columns

group_vars()

Get the grouping variables

group_split()

Split data frame by groups

first() last() nth()

Extract the first, last, or nth value from a vector

if_all() if_any()

Create conditions on a selection of columns

if_else()

Fast if_else

is_grouped_df()

Check if the tidytable is grouped

lag() lead()

Get lagging or leading values

left_join() right_join() inner_join() full_join() anti_join() semi_join()

Join two data.tables together

mutate_rowwise()

Add/modify columns by row

n()

Number of observations in each group

n_distinct()

Count the number of unique values in a vector

na_if()

Convert values to NA

nest_by()

Nest data.tables

nest_join()

Nest join

pick()

Selection version of across()

pull()

Pull out a single variable

relocate()

Relocate a column to a new position

rename()

Rename variables by name

rename_with()

Rename multiple columns

reframe()

Reframe a data frame

row_number() min_rank() dense_rank() percent_rank() cume_dist()

Ranking functions

rowwise()

Convert to a rowwise tidytable

slice_head() slice_tail() slice_max() slice_min() slice() slice_sample()

Choose rows in a data.table

transmute()

Add new variables and drop all others

tribble()

Rowwise tidytable creation

tidyr

complete()

Complete a data.table with missing combinations of data

crossing()

Create a data.table from all unique combinations of inputs

drop_na()

Drop rows containing missing values

expand() nesting()

Expand a data.table to use all combinations of values

expand_grid()

Create a data.table from all combinations of inputs

extract()

Extract a character column into multiple columns using regex

fill()

Fill in missing values with previous or next value

nest()

Nest columns into a list-column

pivot_longer()

Pivot data from wide to long

pivot_wider()

Pivot data from long to wide

replace_na()

Replace missing values

separate()

Separate a character column into multiple columns

separate_rows()

Separate a collapsed column into multiple rows

separate_longer_delim()

Split a string into rows

separate_wider_delim()

Separate a character column into multiple columns

separate_wider_regex()

Separate a character column into multiple columns using regex patterns

uncount()

Uncount a data.table

unite()

Unite multiple columns by pasting strings together

unnest()

Unnest list-columns

unnest_longer()

Unnest a list-column of vectors into regular columns

unnest_wider()

Unnest a list-column of vectors into a wide data frame

purrr

map() map_lgl() map_int() map_dbl() map_chr() map_dfc() map_dfr() map_df() walk() map_vec() map2() map2_lgl() map2_int() map2_dbl() map2_chr() map2_dfc() map2_dfr() map2_df() map2_vec() pmap() pmap_lgl() pmap_int() pmap_dbl() pmap_chr() pmap_dfc() pmap_dfr() pmap_df() pmap_vec()

Apply a function to each element of a vector or list

reexports

These functions are reexported from data.table, rlang, and tidyselect for easier access.

reexports starts_with contains ends_with everything any_of all_of matches num_range last_col where data.table fwrite getDTthreads setDTthreads %between% %like% %chin% enexpr enexprs enquo enquos expr exprs quo quos sym syms glimpse

Objects exported from other packages

tidytable constructors

A tidytable is simply a data.table with nice printing features.

Note: All tidytable functions automatically convert data.frame/tibble inputs to a data.table/tidytable.

as_tidytable()

Coerce an object to a data.table/tidytable

is_tidytable()

Test if the object is a tidytable

new_tidytable()

Create a tidytable from a list

tidytable()

Build a data.table/tidytable

Read/write files

fread() is a simple wrapper around data.table::fread() that returns a tidytable. fwrite() is reexported for use by the user.

fread()

Read/write files