Skip to content

Instantly share code, notes, and snippets.

@wolkym
Created August 19, 2016 16:12
Show Gist options
  • Save wolkym/ed7b8e8a36a9d575ddee3d2cec10fa9c to your computer and use it in GitHub Desktop.
Save wolkym/ed7b8e8a36a9d575ddee3d2cec10fa9c to your computer and use it in GitHub Desktop.
data.table cross join
library(data.table)
dt1 = data.table(a = 1:4, b = 4:1)
dt2 = data.table(c = letters[1:4])
dt2[, dt1[], by = c]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment