[19093] in s-news-athena
Re: [S] logical and numeric NA's
daemon@ATHENA.MIT.EDU (Prof Brian D Ripley)
Thu Sep 2 01:47:09 1999
Date: Thu, 2 Sep 1999 06:42:09 +0100 (BST)
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
To: Babette Brumback <brumback@biostat.washington.edu>
Cc: s-news@wubios.wustl.edu
In-Reply-To: <Pine.GSO.4.10.9909011529530.21632-100000@gibson1>
Message-Id: <Pine.GSO.4.05.9909020629510.11166-100000@auk.stats>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 1 Sep 1999, Babette Brumback wrote:
> Many thanks for your detailed reply. I used version 4.5 for the PC.
> The logical NA was created by b_NA, whereas the
> numerical one was copied from a dataframe that had been
> imported into version 4.5 from stata.
Yes, that is almost certainly the problem. import.data in 4.5 can import
NAs as NaNs. I believe that has been corrected in 2000. It has caused a lot
of confusion.
> What alarms me is that somehow I managed to get by unaware since
> the beginning of graduate school (1991)
> using the unapproved query a=="NA" (which I must have learned
> through trial and error rather than from a manual), and I only
> noticed the trouble this can cause a few months ago.
> Perhaps these days this behaviour is not only well documented, but also
> assigned a special warning message and taught in all (most) introductory
> Splus courses. If not, probably it should be...
It is the problem in import.data that has brought it to the surface.
I hope using is.na is taught now: we do have it in Venables & Ripley
right after introducing NA, then a warning against x == NA (but not
x == "NA", which needs the idea of coercion).
In S-PLUS 5 the recommended way to set an NA is is.na(x) <- T
(Chambers, 1988, p. 143), as there can be yet more types of NAs.
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news