Summary returns a weird character string that is just plain ugly in my opinion. Here's an alternative for getting similar summary output in a table:
summ <- function(x){
tmp<-quantile(x, c(0,.25,.5,.75,1))
names(tmp)<-c("Min", "1st Qu.", "Median", "3rd Qu.", "Max")
return(tmp)}
Sapply data with the function to return more flexible data.frame:
t(sapply(swiss, summ) )
Min 1st Qu. Median 3rd Qu. Max
Fertility 35.00 64.700 70.40 78.450 92.5
Agriculture 1.20 35.900 54.10 67.650 89.7
Examination 3.00 12.000 16.00 22.000 37.0
Education 1.00 6.000 8.00 12.000 53.0
Catholic 2.15 5.195 15.14 93.125 100.0
Infant.Mortality 10.80 18.150 20.00 21.700 26.6
With @pachamaltese answer above, the final summary table should be free of the unncessary Min. :
within the table.