?tapply ?aggregate -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Daren Tan > Sent: Tuesday, June 10, 2008 9:37 AM > To: r-help@r-project.org > Subject: [R] Fast method to compute average values of duplicated IDs > > > Hi, > > How do I collapse (average in the simplest case) the values > of those duplicated ids (i.e., 2, 5, 6, 9) to give a table of > unique ids ? > > t <- cbind(id=c(1:10, 2,5,6,9), value=rnorm(14)) > > > > _________________________________________________________________ > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > ______________________________________________ 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.