Re: [R] Convert a "by" list into a data frame

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 27 Jun 2005 - 12:32:43 EST

On 6/26/05, Tudor Bodea <gtg757i@mail.gatech.edu> wrote:
> Dear useRs,
>
> Is there a way to convert a list generated by "by" command into a data frame?

Here is an example which creates a by object whose elements are the first row of each Species of iris. The next line converts that to a data frame:

   by.object <- by(iris, iris$Species, head, 1)    do.call("rbind", by.object)



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 Received on Mon Jun 27 12:36:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:03 EST