[Rd] hasNA() / anyNA()?

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Aug 14 15:21:13 CEST 2007


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



More information about the R-devel mailing list