I have a transient amnesia. I recall there's an R function that allows to get list of elements in a group after aggregating. To be clearer, from here:
DT<-data.table(x=rep(c("cool","uncool"),each=3),group=c(1,1,2,2,3,3))
That gives:
x group
cool 1
cool 1
cool 2
uncool 2
uncool 3
uncool 3
I would like to end up with:
x group
cool 1,1,2
uncool 2,3,3
I used that function in the past, but can't remember now. Anyone can help? Thank you