base R and genefilter have opposite definitions of anyNA()
1
0
Entering edit mode
@mikelove
Last seen 1 hour ago
United States
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) > anyis.na(x)) [1] TRUE > base::anyNA(x) [1] TRUE > genefilter::anyNA(x) [1] FALSE base man page says: "The generic function ?anyNA? implements ?anyis.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
• 1.7k views
ADD COMMENT
0
Entering edit mode
Sonali Arora ▴ 390
@sonali-arora-6563
Last seen 8.0 years ago
United States
Hi Michael, I have just deprecated genefilter::anyNA and genefilter::allNA in the devel branch. (Version: 1.47.5 of genefilter) On 5/20/2014 6:52 AM, Michael Love wrote: > 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) >> anyis.na(x)) > [1] TRUE >> base::anyNA(x) > [1] TRUE >> genefilter::anyNA(x) > [1] FALSE > > base man page says: > "The generic function ?anyNA? implements ?anyis.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 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Thanks and Regards, Sonali
ADD COMMENT
0
Entering edit mode

It's now two years on. Could the two functions be removed from genefilter now?

ADD REPLY

Login before adding your answer.

Traffic: 666 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6