Skip to content
Prev 307760 / 398506 Next

Summary using by() returns character arrays in a list

Hi

But i still wonder what is wrong on aggregate?

aggregate(iris, list(iris$Species), summary)

gives you somewhat complicated data frame with numeric values, which you can extract as you wish.
[1] "Sepal.Length"
Min. 1st Qu. Median  Mean 3rd Qu. Max.
[1,]  4.3   4.800    5.0 5.006     5.2  5.8
[2,]  4.9   5.600    5.9 5.936     6.3  7.0
[3,]  4.9   6.225    6.5 6.588     6.9  7.9
Regards
Petr