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

Gabor Grothendieck ggrothendieck at gmail.com
Mon Jun 27 04:32:43 CEST 2005


On 6/26/05, Tudor Bodea <gtg757i at 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)




More information about the R-help mailing list