Hello,
I believe that
by( data.ex, data.ex[,c(3,4)], function(x) x[which.max(x[,1]),] )
does what you want. Then,
do.call( rbind, by( data.ex, data.ex[,c(3,4)], function(x)
x[which.max(x[,1]),] ) )
looks somewhat nicer.
Best regards,
Carlos J. Gil Bellosta
http://www.datanalytics.com
On Fr
All,
For data consisting of serial measurements on subjects, one may use the
aggregate function to say compute the peak response for each subject for
each design condition. Is there a way to alter this or another one-liner to
also retain the time at which the peak occurred and thus avoid writing
2 matches
Mail list logo