[R] rbind-ing vectors inside lists

From: Domenico Vistocco <vistocco_at_unicas.it>
Date: Fri 18 Aug 2006 - 03:48:38 EST

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. Received on Fri Aug 18 03:52:06 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.