IN r how to combine resumes together

Let's say I have 5 summaries for 5 datasets. how can i get these numbers or combine resume in 1, not 5

V1 V2 V3 V4 Min. : 670.2 Min. : 682.3 Min. : 690.7 Min. : 637.6 1st Qu.: 739.9 1st Qu.: 737.2 1st Qu.: 707.7 1st Qu.: 690.7 Median : 838.6 Median : 798.6 Median : 748.3 Median : 748.3 Mean : 886.7 Mean : 871.0 Mean : 869.6 Mean : 865.4 3rd Qu.:1076.8 3rd Qu.:1027.6 3rd Qu.:1070.0 3rd Qu.: 960.8 Max. :1107.8 Max. :1109.3 Max. :1131.3 Max. :1289.6 V5 Min. : 637.6 1st Qu.: 690.7 Median : 748.3 Mean : 924.3 3rd Qu.: 960.8 Max. :1584.3 

as I can see 1 table

  v1 v2 v3 v4 v5 Min. : 1st Qu.: Median : Mean : 3rd Qu.: Max. : 

or how to save these numbers as a vector so that I can use the matrix to create the table

+6
r summary
source share
2 answers

It looks like your data is in a frame or data matrix. If so, you can do the following:

 > df <- data.frame(a=1:50, b=3:52, c=rnorm(500)) > apply(df, 2, summary) abc Min. 1.0 3.0 -3.724000 1st Qu. 13.0 15.0 -0.733000 Median 25.5 27.5 -0.004868 Mean 25.5 27.5 -0.033950 3rd Qu. 38.0 40.0 0.580800 Max. 50.0 52.0 2.844000 
+6
source share

You can convert the resulting output to a matrix, and then link 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 the apply (or plyr ) function:

 library(plyr) ldply(list(a, b, c), summary) 
+5
source share

All Articles