R programming R ( data.table ) aggregation 사용 흰곰곰 2019. 10. 9. 21:42 2019-08-06-R_(data.table)_aggregation사용 R ( data.table ) aggregation 사용 xlibrary(data.table);library(reshape2)t = data.frame(col1=c('AAA','AAA','AAA','BBB','BBB'), col2=c('aaa','bbb','ccc','ddd','eee'))tt1<-data.table(t) ;func = function(x){ return(list(list(x))) }t1[, func(col2), by = 'col1']