I have mydata$var and I have mydata$group #two group I would like to split mydata$var by mydata$group #to get var1 and var2 And then get summary (var1, var2) #this is my finite aim How to encode it all?