On Aug 3, 2009, at 9:24 AM, Rnewbie wrote:


Dear all,

I have a dataset, and I wanted to merge the rows with duplicated IDs by calculating the means or medians from the duplicate rows. I tried using the command duplicated(x), but it only tells where the duplicated rows are.

You might want to look at the ave function. It will calculate a function within IDs and you can assign that as another row in the datafrme before you exclude the duplicates.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org 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.

Reply via email to