in R, question about generate table

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-04-20T16:36:51Z Indexed on 2010/04/20 16:43 UTC
Read the original article Hit count: 236

Filed under:

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 dont reli work here...can anyone help

            1     2     3      4        5

min

1st quartile

median

SEM

VAR

THIS IS WHAT I WANT THE TABLE LOOKS LIKE ..

© Stack Overflow or respective owner

Related posts about r