You can use fBasics package sample(c("A","B","C"),size=20,replace = T) -> type rnorm(20) -> value data.frame(ty=type,val=value) -> test
require(fBasics) nam <- rownames(basicStats(test$val)) result <- do.call("cbind", with(test, tapply(val, ty, basicStats))) rownames(result) <- nam result Bests. ----- ..ooo0 ................................................................................................... ..(....)... 0ooo... Walmes Zeviani ...\..(.....(.....)... Master in Statistics and Agricultural Experimentation ....\_)..... )../.... walmeszevi...@hotmail.com, Lavras - MG, Brasil ............ (_/............................................................................................ -- View this message in context: http://r.789695.n4.nabble.com/basic-table-statistics-tp2062829p2063832.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.