Re: [R] How to combine matrix and vector

2010-09-16 Thread Wonsang You
Thank you so much for your help. It was successful to combine matrix and vector by using "rbind" as follows. > a<-matrix(seq(1:10),nrow=2,ncol=5,byrow=TRUE) > a [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]6789 10 > b<-t(c(11,12,13,14,15)) > b [,1] [,2]

Re: [R] How to combine matrix and vector

2010-09-16 Thread Ivan Calandra
Hi! Take a look at rbind() Btw, I don't think you have to transpose b. HTH, Ivan Le 9/16/2010 11:09, Wonsang You a écrit : > Dear fellows, > > I am a novice in R. I would like to combine a matrix and a vector. Assume > that we have the matrix a and the vector b with same length of column. > >

[R] How to combine matrix and vector

2010-09-16 Thread Wonsang You
Dear fellows, I am a novice in R. I would like to combine a matrix and a vector. Assume that we have the matrix a and the vector b with same length of column. a<-matrix(seq(1:10),nrow=2,ncol=5,byrow=TRUE) a= 12345 6789 10 b<-t(c(11,12,13,14,15)) b= 11 12 13 1