Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

expand..html

Expand a data.table to use all combinations of values


Description

Generates all combinations of variables found in a dataset.

expand.() is useful in conjunction with joins:

  • use with right_join.() to convert implicit missing values to explicit missing values

  • use with anti_join.() to find out which combinations are missing

Usage

expand.(.df, ..., .name_repair = "check_unique")

Arguments

.df

A data.frame or data.table

...

Columns to get combinations of

.name_repair

Treatment of duplicate names. See ?vctrs::vec_as_names for options/details

Examples

test_df <- tidytable(x = 1:2, y = 1:2)

test_df %>%
  expand.(x, y)

tidytable

Tidy Interface to 'data.table'

v0.6.1
MIT + file LICENSE
Authors
Mark Fairbanks [aut, cre], Abdessabour Moutik [ctb], Matt Carlson [ctb], Ivan Leung [ctb], Ross Kennedy [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.