Re: [R] 'all' inconsistent?

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Tue 31 Jan 2006 - 02:58:48 EST

Seth Falcon wrote:

> On 30 Jan 2006, ligges@statistik.uni-dortmund.de wrote:
>

>>Current behaviour is consistent in so far that identical(all(x),
>>!any(!x)) is TRUE and definition of any() is obvious.

>
>
> That helps, thanks. I'm not sure I've had enough coffee to continue,
> but, for the set analogy I think we are saying:
>
> logical(0) is the empty set {}.
> Complement of {} is the universal set U.
>
> Then !logical(0) == !{} == U. any(U) is TRUE, isn't it?

Hmmm, "!" is for *logical* negation, and indeed identical(logical(0), !(logical(0))) is TRUE, hence my first statement holds.

> I guess the real message is that you need to protect yourself by
> testing for positive length first.

Yes, indeed.

Uwe

> + seth
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jan 31 03:15:22 2006

This archive was generated by hypermail 2.1.8 : Tue 31 Jan 2006 - 08:22:15 EST