[R] ( data.table ) aggregation 사용

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']

R_data_table_aggregation_image_1

RiverZayden

RiverZayden

AI Data Scientist

댓글