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

Tudor Bodea gtg757i at mail.gatech.edu
Mon Jun 27 04:10:14 CEST 2005


Dear useRs,

Is there a way to convert a list generated by "by" command into a data frame?
Or, more generally, are there any functions that operate on "by" lists?
My "by" list consists of numeric vectors of equal length and the objective is
to calculate the sum of the same index elements (i.e., column-wise sums). For
example, if the "by" list were

--------------------------
Data_DF$CASE: 1
       IVTT     COST
[1,]     1        2
--------------------------
Data_DF$CASE: 2
       IVTT     COST
[1,]     2        4
---------------------------

I would like to finally obtain a numeric vector:

result
[1]  1.5   3

Thank you.

--
Tudor Dan Bodea
Georgia Institute of Technology
School of Civil and Environmental Engineering




More information about the R-help mailing list