Displaying 1 result from an estimated 1 matches for "datares_sinus_variable".
2011 Apr 28
1
Extract complete rows by group and maximum
...group.
Thus I have a dataframe:
cvd_basestudy ... es_time ...
_____________
study1 ... 0.3091667
study2 ... 0.3091667
study2 ... 0.2625000
study3 ... 0.3033333
study3 ... 0.2625000
__________
etc
I can extract the basestudy and the max(es_time) using ddply
ddply(datares_sinus_variable, .(cvd_basestudy),
function(x){max(x[['es_time']])})
or by
by(datares_sinus_variable$es_time, datares_sinus_variable$cvd_basestudy,
max)
but how do I extract the whole line so that I can get a dataframe with
all the data for the maximum line?
(dput output from first 5 rows of my actual da...