[R] a < b < c is alway TRUE

Monika Ferster ferster at stat.math.ethz.ch
Fri Jul 6 12:08:51 CEST 2001


Uwe Ligges writes:
 > One of our students did something like:
 > 
 >   x[a < b < c]
 > 
 > instead of 
 > 
 >   x[a < b & b < c]
 > 
 > 
 > But why is
 > 
 >   3 < 2 < 1	# [1] TRUE ???
 > 

3 < 2 < 1 seems to be seen like a double no because 3 < 2 < 1 < 0 returns
F. It looks like the multiplication of -1 what is strange, because F
corresponds to the value 0. So if you do (3<2)*(2<1) you get 0 and not the
value of T (=1).
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list