| dtjoin_cross | R Documentation |
DT and i using
a DT[i]-style interface to data.tableWrite (and optionally run) data.table code to return the cross join of
two data.frame-like objects using a generalisation of DT[i]
syntax.
The function fjoin_cross provides a more conventional interface
that is recommended over dtjoin_cross for most users and cases.
dtjoin_cross(
.DT = NULL,
.i = NULL,
select = NULL,
select.DT = NULL,
select.i = NULL,
i.home = FALSE,
i.first = i.home,
prefix = if (i.home) "x." else "i.",
i.class = i.home,
do = !(is.null(.DT) && is.null(.i)),
show = !do,
...
)
.DT, .i |
|
select, select.DT, select.i |
Character vectors of columns to be selected
from either input if present ( |
i.home |
Whether to treat |
i.first |
Whether to place |
prefix |
A prefix to attach to column names in the "foreign" table that
are the same as a column name in the "home" table. The default is
|
i.class |
Whether the |
do |
Whether to execute the join. Default is |
show |
Whether to print the code for the join to the console. Default is
the opposite of |
... |
Further arguments (for internal use). |
Details are as for dtjoin except for remarks about join
columns and matching logic, which do not apply.
A data.frame, data.table, (grouped) tibble, sf,
or sf-tibble, or else NULL if do is FALSE. See
Details.
See the package-level documentation fjoin for related
functions.
# data frames
df1 <- data.table::fread(data.table = FALSE, input = "
bread kcal
Brown 150
White 180
Baguette 250
")
df2 <- data.table::fread(data.table = FALSE, input = "
filling kcal
Cheese 200
Pâté 160
")
dtjoin_cross(df1, df2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.