Skip to content
Prev 189614 / 398498 Next

problem selecting rows meeting a criterion

Works fine for me:
+ 2  2 1 8.062258
+ 3  3 1 2.236068
+ 4  4 1 6.324555
+ 5  5 1 5.000000
+ 6  1 2 8.062258
+ 8  3 2 9.486833
+ 9  4 2 2.236068
+ 10 5 2 5.656854
+ 11 1 3 2.236068
+ 12 2 3 9.486833
+ 14 4 3 8.062258
+ 15 5 3 5.099020
+ 16 1 4 6.324555
+ 17 2 4 2.236068
+ 18 3 4 8.062258
+ 20 5 4 5.385165
+ 21 1 5 5.000000
+ 22 2 5 5.656854
+ 23 3 5 5.099020
+ 24 4 5 5.385165"), header=TRUE)
X Y       V3
2  2 1 8.062258
3  3 1 2.236068
4  4 1 6.324555
5  5 1 5.000000
6  1 2 8.062258
8  3 2 9.486833
9  4 2 2.236068
10 5 2 5.656854
11 1 3 2.236068
12 2 3 9.486833
14 4 3 8.062258
15 5 3 5.099020
16 1 4 6.324555
17 2 4 2.236068
18 3 4 8.062258
20 5 4 5.385165
21 1 5 5.000000
22 2 5 5.656854
23 3 5 5.099020
24 4 5 5.385165
X Y       V3
2  2 1 8.062258
3  3 1 2.236068
4  4 1 6.324555
5  5 1 5.000000
8  3 2 9.486833
9  4 2 2.236068
10 5 2 5.656854
14 4 3 8.062258
15 5 3 5.099020
20 5 4 5.385165
do 'str(data)' so that we can see what the structure of your data is.
Also is would be good to use 'dput' to include your data so others can
test with it easier.  'dput' on the value of 'x' I read in gives:
structure(list(X = c(2L, 3L, 4L, 5L, 1L, 3L, 4L, 5L, 1L, 2L,
4L, 5L, 1L, 2L, 3L, 5L, 1L, 2L, 3L, 4L), Y = c(1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L
), V3 = c(8.062258, 2.236068, 6.324555, 5, 8.062258, 9.486833,
2.236068, 5.656854, 2.236068, 9.486833, 8.062258, 5.09902, 6.324555,
2.236068, 8.062258, 5.385165, 5, 5.656854, 5.09902, 5.385165)), .Names = c("X",
"Y", "V3"), class = "data.frame", row.names = c("2", "3", "4",
"5", "6", "8", "9", "10", "11", "12", "14", "15", "16", "17",
"18", "20", "21", "22", "23", "24"))
This makes it easy to reproduce your example.  It might be the case
that "X" and "Y" are factors, but we can not tell that from your
email.
On Mon, Aug 10, 2009 at 7:44 PM, Jim Bouldin<jrbouldin at ucdavis.edu> wrote: