How to adjust a data table manipulation so that, besides sum per category of several colums, it would also calculate other functions at the same time such as <
sum
Here's a data.table answer:
funs_list <- lapply(FunChoice, as.symbol) dcast(dt, category~1, fun=eval(funs_list), value.var = Colchoice)
It's super fast and does what you want.