[R] How to or or and all the values in a logical vector?

Peng Yu pengyu.ut at gmail.com
Sat Sep 5 04:37:07 CEST 2009


Hi,

Suppose I have a logical vector x, I want to compute the 'and' and
'or' of all its element (the result should be a single value TRUE or
FALSE). I have read the R-intro.pdf logical vector section, but I
don't find the answer. Can somebody let me know how to do it?

>x= rep(TRUE, 3)

Regards,
Peng




More information about the R-help mailing list