While fixing #713, came across another potential bug that needs to be fixed.
library(data.table)
DT <- data.table(id=rep(1:2, c(3,2)), k=c(letters[1:3], letters[1:2]), v=1:5)
Now, if we do:
dcast.data.table(DT, id ~ k, fun.aggregate=last)
this should result in error, beause last(integer(0)) is integer(0), which is not of length 1. The error message should indicate this and provide the solution that the function needs to be modified or fill= argument has to be explicitly set. Ex:
dcast.data.table(DT, id ~ k, fun.aggregate=last, fill=NA)