I have a table of data. Col 1 Case Number, Col 2 Group and Col 3 actual values. I want group-wise summaries of this data in R. So if I have three groups I can do
m1=subset(m,group == 1)
m2=subset(m,group == 2)
m3=subset(m,group == 3)
and then
summary(m1)
summary(m2)
summary(m3)
I am looking for a shortcut to these sets of commands, so that I can do it for any number of groups in my data.
Assuming that
grouphas only 3 levels (distinct/unique values), you can do