Hi, a very basic question: What ist the easiest way in R to concatenate two lists of vectors? E.g, I have x<-list(c(1,2)) y<-list(c(3,4)) and I want to receive list(c(1,2),c(3,4)) thank you! Axel ________________________________________ Fraunhofer Institut fuer Arbeitswirtschaft und Organisation (IAO) Dipl. Inf. Axel Benz Nobelstr. 12 D-70569 Stuttgart Germany Tel. +49(0)7119702289 Fax. +49(0)7119702192 mail: mailto:axel.benz@iao.fhg.de www: http://www.vis.iao.fhg.de ________________________________________ [[alternative HTML version deleted]]
c(x,y) will do it. Hope this helps -Matt -----Original Message----- From: Axel Benz [mailto:axel.benz at iao.fhg.de] Sent: Friday, September 19, 2003 8:57 AM To: r-help at stat.math.ethz.ch Subject: [R] newby problem - concatenate lists Hi, a very basic question: What ist the easiest way in R to concatenate two lists of vectors? E.g, I have x<-list(c(1,2)) y<-list(c(3,4)) and I want to receive list(c(1,2),c(3,4)) thank you! Axel ________________________________________ Fraunhofer Institut fuer Arbeitswirtschaft und Organisation (IAO) Dipl. Inf. Axel Benz Nobelstr. 12 D-70569 Stuttgart Germany Tel. +49(0)7119702289 Fax. +49(0)7119702192 mail: mailto:axel.benz at iao.fhg.de www: http://www.vis.iao.fhg.de ________________________________________ [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Lists are just like vectors:> x<-list(c(1,2)) > y<-list(c(3,4)) > c(x,y)[[1]] [1] 1 2 [[2]] [1] 3 4 HTH, Andy> -----Original Message----- > From: Axel Benz [mailto:axel.benz at iao.fhg.de] > Sent: Friday, September 19, 2003 8:57 AM > To: r-help at stat.math.ethz.ch > Subject: [R] newby problem - concatenate lists > > > Hi, > a very basic question: > What ist the easiest way in R to concatenate two lists of > vectors? E.g, I have > x<-list(c(1,2)) > y<-list(c(3,4)) > and I want to receive > list(c(1,2),c(3,4)) > > thank you! > > Axel > ________________________________________ > Fraunhofer Institut fuer > Arbeitswirtschaft und Organisation (IAO) > Dipl. Inf. Axel Benz > Nobelstr. 12 > D-70569 Stuttgart > Germany > Tel. +49(0)7119702289 > Fax. +49(0)7119702192 > mail: mailto:axel.benz at iao.fhg.de > www: http://www.vis.iao.fhg.de > ________________________________________ > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo> /r-help >
Axel Benz wrote:> Hi, > a very basic question: > What ist the easiest way in R to concatenate two lists of vectors? > E.g, I have > x<-list(c(1,2)) > y<-list(c(3,4)) > and I want to receive > list(c(1,2),c(3,4))What about c(x, y) ??? Uwe Ligges> thank you! > > Axel > ________________________________________ > Fraunhofer Institut fuer > Arbeitswirtschaft und Organisation (IAO) > Dipl. Inf. Axel Benz > Nobelstr. 12 > D-70569 Stuttgart > Germany > Tel. +49(0)7119702289 > Fax. +49(0)7119702192 > mail: mailto:axel.benz at iao.fhg.de > www: http://www.vis.iao.fhg.de > ________________________________________ > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Fri, 19 Sep 2003, Axel Benz wrote:> Hi, > a very basic question: > What ist the easiest way in R to concatenate two lists of vectors? > E.g, I have > x<-list(c(1,2)) > y<-list(c(3,4)) > and I want to receive > list(c(1,2),c(3,4))c(x,y) -thomas