set.seed(42) #to get the same values each time
x.df <- data.frame(group=sample(2,20,replace=TRUE), matrix(rnorm(100),ncol=5))
x <- describe.by(x.df,x.df$group)
x #shows all the results
x[1] #shows just the first group
x <- matrix(sample(4,200,replace=TRUE),ncol=5)
y <- describe.by(x,x[,1])
y
Run the code above in your browser using DataLab