[R] How to combine matrix and vector

Wonsang You you at ifn-magdeburg.de
Thu Sep 16 16:57:11 CEST 2010


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,]    1    2    3    4    5
[2,]    6    7    8    9   10

> b<-t(c(11,12,13,14,15))
> b
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   12   13   14   15

> rbind(a,b)
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    2    3    4    5
[2,]    6    7    8    9   10
[3,]   11   12   13   14   15




-----
--
Wonsang You
Special Lab Non-Invasive Brain Imaging
Leibniz Institute for Neurobiology
http://www.ifn-magdeburg.de
-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-combine-matrix-and-vector-tp2541797p2542362.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list