Seth Falcon wrote:

> On 29 Jan 2006, [EMAIL PROTECTED] wrote:
>
>> On Sun, 29 Jan 2006, Elizabeth Purdom wrote:
>>
>>> I came across the following behavior, which seems illogical to me.
>>
>> What did you expect and why?
>>
>>> I don't know if it is a bug or if I'm missing something:
>>>
>>>> all(logical(0))
>>> [1] TRUE
>>
>> All the values are true, all none of them.
>
> I thought all the values are false, all none of them, because there
> aren't any that are true:
>
> any(logical(0))
> [1] FALSE

But they are, all none of them:

> all(!logical(0))
[1] TRUE

:-)

And there aren't any FALSE values either:

> any(!logical(0))
[1] FALSE

so it is only logical that all none of them are TRUE.  I love the
empty set! :-)

-- 
Bjørn-Helge Mevik

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to