[BioC] base R and genefilter have opposite definitions of anyNA()

Michael Love michaelisaiahlove at gmail.com
Tue May 20 15:52:30 CEST 2014


hi,

anyNA() has been added to base R, but the definition is the opposite
of genefilter::anyNA, which can be dangerous obviously. of course,
there is also the issue of legacy code.

> x <- c(1:3,NA)
> any(is.na(x))
[1] TRUE
> base::anyNA(x)
[1] TRUE
> genefilter::anyNA(x)
[1] FALSE

base man page says:
"The generic function ‘anyNA’ implements ‘any(is.na(x))’ in a possibly
faster way (especially for atomic vectors)."

genefilter man page says:
"‘anyNA’ evaluates to ‘FALSE’ if any of the elements of its argument are ‘NA’."

Here is a thread about adding anyNA() to base R
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15239

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin12.5.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] genefilter_1.46.0

loaded via a namespace (and not attached):
 [1] annotate_1.42.0      AnnotationDbi_1.26.0 Biobase_2.24.0
 [4] BiocGenerics_0.10.0  DBI_0.2-7            GenomeInfoDb_1.0.2
 [7] IRanges_1.22.3       parallel_3.1.0       RCurl_1.95-4.1
[10] RSQLite_0.11.4       splines_3.1.0        stats4_3.1.0
[13] survival_2.37-7      XML_3.98-1.1         xtable_1.7-3



More information about the Bioconductor mailing list