[R] newby problem - concatenate lists

Liaw, Andy andy_liaw at merck.com
Fri Sep 19 15:03:06 CEST 2003


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
>




More information about the R-help mailing list