[R] adding list to data.frame iteratively

2010-09-08 Thread raje...@cse.iitm.ac.in
Hi, I have a preallocated dataframe to which I have to add a list whose vectors will become rows in the dataframe. This is done iteratively. How can I do this? I'm dealing with very large numbers...list of 1000 vectors to a dataframe of 20 iteratively for e.g. my list is as follows

Re: [R] adding list to data.frame iteratively

2010-09-08 Thread fishkbob
ll-list(c(1,2,3),c(2,3,4)) ll [[1]] [1] 1 2 3 [[2]] [1] 2 3 4 dd-data.frame(matrix(nrow=10,ncol=3)) dd X1 X2 X3 1 NA NA NA 2 NA NA NA 3 NA NA NA 4 NA NA NA 5 NA NA NA 6 NA NA NA 7 NA NA NA 8 NA NA NA 9 NA NA NA 10 NA NA NA dd[1,]-ll[[1]] dd X1 X2 X3 1 12

Re: [R] adding list to data.frame iteratively

2010-09-08 Thread Joshua Wiley
Hi, This is not exactly the same, but there was a recent thread on rbind()ing dataframes from a list: http://r.789695.n4.nabble.com/Please-explain-do-call-in-this-context-or-critique-to-stack-this-list-faster-td2526908.html Given that, I wonder if this would work for you: ll -

Re: [R] adding list to data.frame iteratively

2010-09-08 Thread Hadley Wickham
Why don't you read the answers to your stackoverflow question? http://stackoverflow.com/questions/3665885/adding-a-list-of-vectors-to-a-data-frame-in-r/3667753 Hadley On Wed, Sep 8, 2010 at 1:17 AM, raje...@cse.iitm.ac.in raje...@cse.iitm.ac.in wrote: Hi, I have a preallocated dataframe to