Re: [R] how to select rows per subset in a data frame that are max. w.r.t. a column

2010-05-18 Thread Dennis Murphy
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

Re: [R] how to select rows per subset in a data frame that are max. w.r.t. a column

2010-05-18 Thread Ivan Calandra
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

[R] how to select rows per subset in a data frame that are max. w.r.t. a column

2010-05-18 Thread Tim Van den Bulcke
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