Cross join each row of x to every row in y.

cross_join(x, y, ..., suffix = c(".x", ".y"))

Arguments

x

A data.frame or data.table

y

A data.frame or data.table

...

Other parameters passed on to methods

suffix

Append created for duplicated column names when using full_join()

Examples

df1 <- tidytable(x = 1:3)
df2 <- tidytable(y = 4:6)

cross_join(df1, df2)
#> # A tidytable: 9 × 2
#>       x     y
#>   <int> <int>
#> 1     1     4
#> 2     1     5
#> 3     1     6
#> 4     2     4
#> 5     2     5
#> 6     2     6
#> 7     3     4
#> 8     3     5
#> 9     3     6