[R] Converting "list of data frame" to data frame

Douglas Bates bates at stat.wisc.edu
Sat Apr 28 16:38:09 CEST 2007


On 4/28/07, Ajit Pawar <ajitpawar75 at gmail.com> wrote:
> Greetings,
>       This might be something very simple but a nice solution eludes me!!
>
>        I have a function that I call within sapply that generates data frame
> in each call. Now when sapply returns me back the result - it's in the form
> of a "list of data frames". so in order to extract the information into a
> single data frame I have to loop thru the following code:
>
>        for(i=1:n) {
>            my.df = rbind(my.df,list.from.sapply[,i]);
>        }
>
>    Is there anyway to code it better?

do.call("rbind", my.df.list.from.sapply)



More information about the R-help mailing list