Skip to content
Prev 334699 / 398506 Next

by class...

You seem to be falling prey to a common misconception that "R" is some monolithic tool, when in fact it is a herd of cats.

The "by" function, from the "base" package, returns a list of results returned by your function. One approach to making a data frame out of that is to use the simplify2array function, transpose, and convert to data frame.

However, there are many other ways to aggregate data as well. Packages plyr, sqldf, data.table all have strengths and weaknesses, but you must always keep in mind that they are contributed packages and you have to refer to the package name if you ask here about using functions from them.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
Onur Uncu <onuruncu at gmail.com> wrote: