[R] adding list to data.frame iteratively

Hadley Wickham hadley at rice.edu
Thu Sep 9 01:35:57 CEST 2010


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, rajeshj at cse.iitm.ac.in
<rajeshj at cse.iitm.ac.in> wrote:
>
> 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 200000 iteratively
>
> for e.g.
> my list is as follows
>
> ll<-list(c("1","2","3"),c("2","3","4"))
>
> I have to add this to a dataframe
> dd<-data.frame(matrix(nrow=10,ncol=3))
>
> so that I get
> 1 2 3
> 2 3 4
> etc.
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list