[R] problem with merging two matrices

flokke flokke at live.de
Wed Nov 2 21:46:10 CET 2011

Dear all, 
I hope you can forgive me my stupid questions, but I am a very new R user (;

So, this is my question:

I have two matrices, 
those are:

matrix1 <- matrix(cbind(vector1, vector2), 1,2, dimnames = list(c("values"), 
                                                               c("T value",
"p value")))

matrix2 <- matrix(dcbind,2,6,dimnames = list(c("x", "y"),
                                  c("Min", "1st qu.", "Median", "Mean", "3rd
qu.", "Max")))

Now, I would like to merge them, but I want to receive the following result:

     Min 1st qu. Median Mean 3rd qu. Max
  x   3      3            4      4        4      4
  y   3       3           3      3         3     3 

       t value p value
value   3           3

so both vectors should stand above each other... 
when I use merge() I dont get this result, also not with cbind or rbind. 
I neither can make a a data frame of the two matrices. 
I think that I should use the function array with dim(6,2,2), but I dont
know how that is exactly working
(I couldn make it working)

I would be very glad if you could let me know how to solve this problem. 


View this message in context: http://r.789695.n4.nabble.com/problem-with-merging-two-matrices-tp3983136p3983136.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list