I think I already got really good answers on the comments, but I will rephrase the question for future reference.
I am trying to sum by groups using data.table. The
Using sum_ from hablar
sum_
hablar
library(hablar) A[, as.numeric(sum_(col2)), .(col1)] # col1 V1 #1: A NA #2: B 5 #3: C 4