require(data.table)
dt <- data.table(a=1, b=2)[0] # empty table
dt[rep(NA_integer_, 10), mean(a), by=list(vv=1:10)] # subset with NA_integer_
This results in segfault.. and would result in the same with median, min, max etc. Since they all depend on the input table, as opposed to gN() (equivalent of .N), for example.
Not sure, but I think this happens because irows is non-empty (all NAs), but x (input table) is. And I think this difference is not taken care of in this line.
This results in segfault.. and would result in the same with
median,min,maxetc. Since they all depend on the input table, as opposed togN()(equivalent of.N), for example.Not sure, but I think this happens because
irowsis non-empty (all NAs), butx(input table) is. And I think this difference is not taken care of in this line.