Hi:
Here are a couple of ways using the doBy and plyr packages:
library(doBy)
library(plyr)
# doBy:
subsetBy(~ wool + tension, subset = breaks == max(breaks), data =
warpbreaks)
breaks wool tension
A|H 43A H
A|L 70A L
A|M 36A M
B|H 28B
Hi,
Maybe it's just me but I don't understand what you're trying to do.
Isn't maxValues what you need?
Providing a reproducible example with your data (using the function
dput), the desired output, and the code you've tried would really help!
Ivan
Le 5/18/2010 10:58, Tim Van den Bulcke a écri
Hi,
I'd like to select one row in a data frame per subset which is maximal for a
particular value. I'm pretty close to the solution in the sense that I can
easily select the maximal values per subset using "aggregate", but I can't
really figure out how to select the rows in the original data fram
3 matches
Mail list logo