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(factor1 = rep(1:2,each=8), factor2 =
rep(c(a,b),each=4,
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 =
-project.org
Subject: [R] How to get minimum value by group
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
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
4 matches
Mail list logo