I couldn't resist, either...
From: Henrik Bengtsson
Hmm,
couldn't resists:
X - NA
is.logical(X)
[1] TRUE
(X == TRUE)
[1] NA
==.MaybeNA - function(e1, e2) { !is.na(e1) (e1 == e2) }
X - structure(NA, class=MaybeNA)
is.logical(X)
[1] TRUE
(X == TRUE)
[1] FALSE
Ta da
4:07 PM
To: R-help Forum
Subject: [R] Department of Redundancy Department.
I just noticed a certain ``usage'' in a recent posting, and
couldn't restrain my self from commenting. The usage was of the form
``if(X==TRUE)''
where X was a logical variable.
This sort of thing
I just noticed a certain ``usage'' in a recent posting, and couldn't
restrain my self from commenting. The usage was of the form
``if(X==TRUE)''
where X was a logical variable.
This sort of thing is brought to you by your Department of Redundancy
Department. The ``==TRUE'' bit is
Hmm,
couldn't resists:
X - NA
is.logical(X)
[1] TRUE
(X == TRUE)
[1] NA
==.MaybeNA - function(e1, e2) { !is.na(e1) (e1 == e2) }
X - structure(NA, class=MaybeNA)
is.logical(X)
[1] TRUE
(X == TRUE)
[1] FALSE
Ta da ;)
Henrik
PS. It might be worth mentioning base::isTRUE() when we're
4 matches
Mail list logo