[R] gettng the row number based on column conditions

gtg maifeng at gmail.com
Sun Nov 14 09:39:41 CET 2010


Hi all, I would like to get the row numbers in X where col1 and col2 are both
1
I tried this:
which(X[,c(1,2)]==1)
but it gives me the row numbers where either col1 or col2 = 1

What should I do? Thank you.
-- 
View this message in context: http://r.789695.n4.nabble.com/gettng-the-row-number-based-on-column-conditions-tp3041549p3041549.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list