I have a data frame that is rather large and I need a good way (explained bellow) to extract indices for rows that have maximum values for a given field, within a certain se
Perhaps this may help:
tapply(seq(dim(d)[1]), d$label, function(rns){rns[which.max(d$value[rns])]} )
(note: I got this trick from the code of 'by')