a = matrix(1:25,5,5)
B = capture.output(for (X in 1:5){
A = c(min(a[,X]),quantile(a[,X],0.25),median(a[,X]),quantile(a[,X],0.75),max(a[,X]),mean(a[,X]),sd(a[,X])/m^(1/2),var(a[,X]))
cat(A,"\n")
})
matrix(B,8,5)
What I was trying to do is to generate a table which each column has those element in A and in that order. I try to use the matrix, but seems like it doesn't really work here. Can anyone help?
| 1 | 2 | 3 | 4 | 5 |
|---------------------------------------------
| min | | | | | |
|---------------------------------------------
| 1st quartile | | | | | |
|---------------------------------------------
| median | | | | | |
|---------------------------------------------
| SEM | | | | | |
|---------------------------------------------
| VAR | | | | | |
The above is what I want the table to look like.