Get all combinations from a dataframe column or from a list

tidy_comb(data, base, ...)

# S3 method for data.frame
tidy_comb(data, base, ...)

# S3 method for default
tidy_comb(data, base, ...)

Arguments

data

data object containing the list of words, either a list or a data.frame

base

the base word to compare with all the words

...

if data is a data.frame, the col where the words to combine are

Value

a tibble with all possible combination of elements from a list

Examples

tidy_comb(iris, "this", Species)
#> # A tibble: 3 x 2 #> V1 V2 #> * <chr> <chr> #> 1 this setosa #> 2 this versicolor #> 3 this virginica
tidy_comb(state.name, "Paris")
#> # A tibble: 50 x 2 #> V1 V2 #> * <chr> <chr> #> 1 Paris Alabama #> 2 Paris Alaska #> 3 Paris Arizona #> 4 Paris Arkansas #> 5 Paris California #> 6 Paris Colorado #> 7 Paris Connecticut #> 8 Paris Delaware #> 9 Paris Florida #> 10 Paris Georgia #> # ... with 40 more rows