Re: [Rd] hasNA() / anyNA()?

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue, 14 Aug 2007 14:21:13 +0100 (BST)

On Tue, 14 Aug 2007, Benjamin Tyner wrote:

> Why not
>
> hasNA <- function(x) !is.na(match(NA, x))

It hashes the whole table (here x) and so is both slower and uses more memory than is.na(x).

I am not clear what is meant by 'efficiency' here, or why it is needed (we have not been told). But writing a C-level function to do this would have taken less time that this discussion has already taken ....

-- 
Brian D. Ripley,                  ripley_at_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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue 14 Aug 2007 - 13:24:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 14 Aug 2007 - 17:38:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.