Displaying 1 result from an estimated 1 matches for "tp2541797p2542362".
2010 Sep 16
2
How to combine matrix and vector
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=
1 2 3 4 5
6 7 8 9 10
b<-t(c(11,12,13,14,15))
b=
11 12 13 14 15
Then, I want to combine a and b as follows.
c=
1 2 3 4 5
6 7 8 9