crossed_join {timeplyr} | R Documentation |
A do.call()
and data.table::CJ()
method
Description
This 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.
Usage
crossed_join(
X,
sort = FALSE,
unique = TRUE,
as_dt = TRUE,
strings_as_factors = FALSE
)
Arguments
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 |
Details
An important note is that currently NA
s
are sorted last and therefore a key is not set.
Value
A data.table or list object.
Examples
library(timeplyr)
crossed_join(list(1:3, -2:2))
crossed_join(iris)
[Package timeplyr version 0.8.1 Index]