Re: [R] summing up colum values for unique IDs when multiple ID's exist in data frame

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Tue, 29 May 2007 14:54:02 -0700 (PDT)


On Tue, 29 May 2007, Seth Falcon wrote:

> "Young Cho" <young.stat@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

______________________________________________
R-help_at_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 and provide commented, minimal, self-contained, reproducible code. Received on Tue 29 May 2007 - 22:03:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 May 2007 - 23:31:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.