Re: [R] a < b < c is alway TRUE

About this list Date view Thread view Subject view Author view Attachment view

From: Peter Malewski (peter.malewski@gmx.de)
Date: Fri 06 Jul 2001 - 20:48:01 EST


Message-id: <20010706124800.A18231@rzpool01.pool.rz.tu-bs.de>


> 3 < 2
[1] FALSE
> F < 1
[1] TRUE
> as.numeric(F)
[1] 0

p.

On Fri, Jul 06, 2001 at 12:08:51PM +0200, Monika Ferster wrote:
> 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@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
P.Malewski, Limmerstr.47, 30451 Hannover, 0511-2135008
At work: http://www.MH-Hannover.de 0511 532 3194 / Fax: 0511 532 3190, 
P.Malewski@tu-bs.de, peter.malewski@gmx.de, malewski.peter@mh-hannover.de.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Wed 10 Mar 2004 - 08:18:18 EST