Re: [R] Fast method to compute average values of duplicated IDs

2008-06-10 Thread Jorge Ivan Velez
Dear Daren, Try this: tapply(t[,"value"],t[,"id"],mean) HTH, Jorge On Tue, Jun 10, 2008 at 11:37 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > 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 ? > >

Re: [R] Fast method to compute average values of duplicated IDs

2008-06-10 Thread Greg Snow
t; 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

[R] Fast method to compute average values of duplicated IDs

2008-06-10 Thread Daren Tan
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 ver