R ( data.table ) aggregation 사용
library(data.table);
library(reshape2)
t = data.frame(col1=c('AAA','AAA','AAA','BBB','BBB'), col2=c('aaa','bbb','ccc','ddd','eee'))
t
t1<-data.table(t) ;
func = function(x){
return(list(list(x))) }
t1[, func(col2), by = 'col1']
댓글