I am attempting to use multicore
function parallel
with data.table
and am unable to quite come up with the right way to do this. Code:
require(multicore)
require(data.table)
dtb = data.table(a=1:10, b=1:2)
x = dtb[,parallel(a+1),by=b]
> x
b pid fd
1: 1 12243 3
2: 1 12243 6
3: 2 12247 4
4: 2 12247 8
I would like to call collect()
on this but these are no longer parallel
objects. How should one do this?