say i have 5 summary for 5 sets of data. how can i get those number out or combine the summary in to 1 rather than 5
V1 V2 V3
You can convert the summary output into a matrix and then bind them:
a <- 1:50
b <- 3:53
c <- rnorm(500)
cbind(as.matrix(summary(a)), as.matrix(summary(b)), as.matrix(summary(c)))
Alternatively, you can combine them into a list and use an apply
function (or plyr
):
library(plyr)
ldply(list(a, b, c), summary)