Skip to content
Prev 138946 / 398506 Next

Deleting rows satisfying a certain condition (sum of some colums>2)

Here is a way of doing it.  You check to see which ones meet the
criteria and then delete them.
meet.crit
 [1,] 2 2 2 2         1
 [2,] 2 2 1 2         1
 [3,] 2 2 1 1         1
 [4,] 2 2 0 2         1
 [5,] 2 2 0 1         1
 [6,] 2 2 0 0         0
 [7,] 1 2 2 2         1
 [8,] 1 2 1 2         1
 [9,] 1 2 1 1         1
[10,] 1 2 0 2         1
[11,] 1 2 0 1         1
[12,] 1 2 0 0         0
[13,] 1 1 2 2         1
[14,] 1 1 1 2         1
[15,] 1 1 1 1         0
[16,] 1 1 0 2         1
[17,] 1 1 0 1         0
[18,] 1 1 0 0         0
[,1] [,2] [,3] [,4]
[1,]    2    2    0    0
[2,]    1    2    0    0
[3,]    1    1    1    1
[4,]    1    1    0    1
[5,]    1    1    0    0

        
On Sat, Mar 8, 2008 at 12:17 AM, Katie C <katie.cheon at gmail.com> wrote: