[R] summing up colum values for unique IDs when multiple ID's exist in data frame
Thomas Lumley
tlumley at u.washington.edu
Tue May 29 23:54:02 CEST 2007
On Tue, 29 May 2007, Seth Falcon wrote:
> "Young Cho" <young.stat at gmail.com> writes:
>
>> I have data.frame's with IDs and multiple columns. B/c some of IDs
>> showed up more than once, I need sum up colum values to creat a new
>> dataframe with unique ids.
>>
>> I hope there are some cheaper ways of doing it... Because the
>> dataframe is huge, it takes almost an hour to do the task. Thanks
>> so much in advance!
>
> Does this do what you want in a faster way?
>
rowsum() should probably be faster (but perhaps not much).
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-help
mailing list