Re: [R] How to get minimum value by group

2010-01-11 Thread Gabor Grothendieck
Try this: > aggregate(myframe[4], myframe[1:3], min) factor1 factor2 factor3 y 1 1 a x 1 2 2 a x 9 3 1 b x 5 4 2 b x 13 5 1 a y 3 6 2 a y 11 7 1 b y 7 8 2

Re: [R] How to get minimum value by group

2010-01-11 Thread Peter Alspach
Tena koe Justin Try aggregate(): e.g., aggregate(myframe[,4], myframe[,1:3], min) HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of JustinNabble > Sent: Tuesday, 12 January 2010 1:58 p.m. > To: r-help

Re: [R] How to get minimum value by group

2010-01-11 Thread David Winsemius
On Jan 11, 2010, at 7:58 PM, JustinNabble wrote: I'd like to get a long data set of minimum values from groups in another data set. The following almost does what I want. (Note, I'm using the word factor differently from it's meaning in R; bad choice of words) myframe = data.frame(facto