Re: [R] rbind-ing vectors inside lists

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Fri 18 Aug 2006 - 03:53:33 EST

Try:

mapply(rbind, a, b, SIMPLIFY = FALSE)

On 8/17/06, Domenico Vistocco <vistocco@unicas.it> wrote:
> Dear helpeRs,
>
> suppose I have two lists as follows:
>
> a = list(1:5,5:9)
> b = lapply(a,"*",2)
>
>
> I would like to rbind-ing the two lists, that is I would like to use
> something as rbind applied
> component to component for the two list.
>
> I have used the following solution:
>
> fun.tile.wt = function(list1, list2)
> {
> for(i in 1:length(list1))
> {
> list1[[i]]=rbind(list1[[i]],list2[[i]])
> }
> list1
> }
> fun.tile.wt(a,b)
>
>
> Is it possible to directly obtain the result using the apply family
> (or something else)?
>
> Any suggestions is appreciated.
>
> Thanks in advance,
> domenico vistocco
> [[alternative HTML version deleted]]
>
>
> Chiacchiera con i tuoi amici in tempo reale!
> http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



R-help@stat.math.ethz.ch 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. Received on Fri Aug 18 03:57:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 18 Aug 2006 - 04:25:25 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.