I want to attach the values of a group together, here is the sample:
data<-data.table(group=c("g1","g1","g2","g2","g1"),value=c(1,2,3,4,5))
my desired output would be:
group value
1: g1 125
2: g2 34
Values could be treated as numbers or characters.