From Martin Maechler <maechler@stat.math.ethz.ch>  Mon Jan  5 07:49:12 1998
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Mon, 5 Jan 1998 08:49:12 +0100
Subject: unary !
In-Reply-To: <Pine.SOL.3.95.980104105608.7341B-100000@gorn> (message from
 Thomas Lumley on Sun, 4 Jan 1998 10:58:25 -0800 (PST))
Message-ID: <199801050749.IAA00426@sophie.ethz.ch>

[spill over from  R-core]

>>>>> "TL" == Thomas Lumley <thomas@biostat.washington.edu> writes:

    TL> On Sun, 4 Jan 1998, Kurt Hornik wrote:
    >> Another thing I noticed when playing with chron is that apparently
    >> code like if (!(length(value)) works in S but not in R.  The error
    >> in R is unary ! is only defined for logical vectors
    >> 
    >> I assume that this is a bug and not a feature (although the code in
    >> src/main/logic.c makes me wonder ...).

    TL> I complained about this more than a year ago and I thought we (or
    TL> in those days R+R) had decided it was a feature -- I just explained
    TL> to someone on r-help that it was one of the deliberate
    TL> incompatibilities that ! didn't work on numerics.

Yes, positively.  We've discussed this quite a bit, and
this was defined to be a feature long ago.

The proper (non C-hacker but normal-user readable) way  is to test for

	if(length(vector) == 0)

- Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


unary !
Martin Maechler