[R] If then test

GlenB glnbrntt at gmail.com
Thu Jan 28 08:37:29 CET 2010



Do you actually need the intermediate result (the vector of 1's and 0's), or
just the result - the total number of columns? 

Is the number you're comparing to different for each column?

Assuming the answers are "just the result" and "comparing to the same
number"

x <- matrix(c(4,5,7,2),nc=2)
num <- 6
sum(apply(x<num,2,all))

-- 
View this message in context: http://n4.nabble.com/If-then-test-tp1322119p1330135.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list