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
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
I thought all the values are false, all none of them, because there
aren't any that are true:
any(logical(0))
[1] FALSE
This is for the same reason why a product over an empty set of
factors is 1, and a sum over an empty set of terms is 0.
GP
--
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
On 30 Jan 2006, [EMAIL PROTECTED] 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
Seth Falcon wrote:
On 30 Jan 2006, [EMAIL PROTECTED] 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
Seth Falcon [EMAIL PROTECTED] writes:
On 30 Jan 2006, [EMAIL PROTECTED] 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
Hello,
I came across the following behavior, which seems illogical to me. I don't
know if it is a bug or if I'm missing something:
all(logical(0))
[1] TRUE
any(logical(0))
[1] FALSE
isTRUE(logical(0))
[1] FALSE
This actually came up in practice when I did something like
all( names(x)
I think the corresponding question was already discussed in
the context of sum and in terms of this question one wants:
all(x) all(y) to equal all(c(x,y))
including the case where x or y has zero length.
On 1/30/06, Elizabeth Purdom [EMAIL PROTECTED] wrote:
Hello,
I came across the following
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.
any(logical(0))
10 matches
Mail list logo