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. > > 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 10 > 11 12 13 14 15 > > If you teach me to easily combine the matrix and the vector, I will greatly > appreciate you. Thank you. > > Regards, > Wonsang > > > ----- > -- > Wonsang You > Special Lab Non-Invasive Brain Imaging > Leibniz Institute for Neurobiology > http://www.ifn-magdeburg.de -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. Säugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calan...@uni-hamburg.de ********** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.