Tuesday, 27 August 2013

do.call rbind of data.table depends on location of NA

do.call rbind of data.table depends on location of NA

Consider this
do.call(rbind, list(data.table(x=1, b='x'),data.table(x=1, b=NA)))
returns
x b
1: 1 x
2: 1 NA
but
do.call(rbind, list(data.table(x=1, b=NA),data.table(x=1, b='x')))
returns
x b
1: 1 NA
2: 1 NA
How can i force the first behavior, without reordering the contents of the
list?
Data table is really really faster in mapreduce jobs (calling data.table
~10*3MM times across 55 nodes, the data table is many many times faster
than data frame, so i want this to work ...) Regards saptarshi

No comments:

Post a Comment