On 1.10.4:
dt <- data.table(x=c(1,1,1),y=c(3,0,0))
setkey(dt, x)
dt[, median(y), by=x]
Yields the following error:
Error in gmedian(y) : negative length vectors are not allowed
If dt doesn't have a key set, it doesn't throw the error (but I can't tell if gmedian is even being called in that case). Also calling stats::median instead of median above works because it bypasses gmedian directly.
On 1.10.4:
Yields the following error:
Error in gmedian(y) : negative length vectors are not allowed
If dt doesn't have a key set, it doesn't throw the error (but I can't tell if gmedian is even being called in that case). Also calling stats::median instead of median above works because it bypasses gmedian directly.