Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206503

R data.table - best option for Cartesian join

$
0
0

I am looking for simple syntax for data.table's cartesian join e.g. I am using as below to get 1024 row in c_join but it requires to convert data.table to data.frame

d1 <- data.table(mtcars)

d2 <- data.table(mtcars)

c_join <- setDT(merge(x=as.data.frame(d1), y=as.data.frame(d2), by=NULL))


Viewing all articles
Browse latest Browse all 206503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>