Skip to content
Prev 175945 / 398503 Next

Selecting all rows of factors which have at least one positive value?

I think the unique function is superfluous:

 > x[x$X1 %in% x$X1[x$X2==1], ]
    X1 X2
1  11  0
2  11  0
3  11  0
4  11  1
8  13  0
9  13  1
10 13  1

--  

David Winsemius
On Apr 2, 2009, at 12:43 PM, Patrizio Frederic wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT