crossed_join | R Documentation |
do.call()
and data.table::CJ()
methodThis function operates like do.call(CJ, ...)
and accepts
a list or data.frame as an argument.
It has less overhead for small joins, especially when unique = FALSE
and
as_dt = FALSE
.
NA
s are by default sorted last.
crossed_join(
X,
sort = FALSE,
unique = TRUE,
as_dt = TRUE,
strings_as_factors = FALSE
)
X |
A list or data frame. |
sort |
Should the expansion be sorted? By default it is |
unique |
Should unique values across each column or list element
be taken? By default this is |
as_dt |
Should result be a |
strings_as_factors |
Should strings be converted to factors before
expansion? The default is |
An important note is that currently NA
s
are sorted last and therefore a key is not set.
A data.table or list object.
library(timeplyr)
crossed_join(list(1:3, -2:2))
crossed_join(iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.