Hi everyone,
Can I suggest an addition to the help page for logical AND and OR,
indicating the behaviour of NA (which is currently not mentioned at
all).  I think something simple like an extra paragraph in Details, eg
\code{NA} is a valid logical object.  Where a component of \code{x} or
\code{y} is \code{NA}, the result will be \code{NA} if the outcome is
ambiguous.  In other words \code{NA & TRUE} evaluates to \code{NA}, but
\code{NA & FALSE} evaluates to \code{FALSE}.  See the examples below.
And so it might also be a good idea to add a truth-table to the
examples, eg
# construct truth table for logical &
x <- c(NA, FALSE, TRUE)
names(x) <- as.character(x)
outer(x, x, "&")
Cheers, Jonathan.
-- 
Jonathan Rougier                       Science Laboratories
Department of Mathematical Sciences    South Road
University of Durham                   Durham DH1 3LE
tel: +44 (0)191 374 2361, fax: +44 (0)191 374 7388
http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "JonR" == Jonathan Rougier <J.C.Rougier@durham.ac.uk> >>>>> on Tue, 20 Aug 2002 14:49:53 +0100 writes:JonR> Hi everyone, JonR> Can I suggest an addition to the help page for logical AND and OR, JonR> indicating the behaviour of NA (which is currently not mentioned at JonR> all). I think something simple like an extra paragraph in Details, eg JonR> \code{NA} is a valid logical object. Where a component of \code{x} or JonR> \code{y} is \code{NA}, the result will be \code{NA} if the outcome is JonR> ambiguous. In other words \code{NA & TRUE} evaluates to \code{NA}, but JonR> \code{NA & FALSE} evaluates to \code{FALSE}. See the examples below. JonR> And so it might also be a good idea to add a truth-table to the JonR> examples, eg JonR> # construct truth table for logical & JonR> x <- c(NA, FALSE, TRUE) JonR> names(x) <- as.character(x) JonR> outer(x, x, "&") Thanks a lot, Jonathan, for the helpful suggestions. I'm adding these to R-devel. 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._