Douglas/R-help,
Thanks for your reply. I did try the solution but the result is not
what I expect and I also get the following warning message:
-------------------
Warning message:
number of columns of result
is not a multiple of vector length (arg 1) in: rbind(1, c(6, 9, 10,
12, 13, 14, 19, 22, 29, 30, 42, 45, 47,
-------------------
The "list of data frames" that sapply returns has same number of
columns *but* different number of rows depending on the index of sapply.
Any idea what might be going wrong?
Many thanks in advance!.
Cheers
AP
On 4/29/07, Douglas Bates <[EMAIL PROTECTED]> wrote:
>
> On 4/28/07, Ajit Pawar <[EMAIL PROTECTED]> 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)
>
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.