R CMD check : biocLite warning
2
0
Entering edit mode
swaraj basu ▴ 50
@swaraj-basu-4629
Last seen 10.3 years ago
Dear All, I am trying to build a package for a set of functions. I am able to build the package and its working fine. When I check it with R CMD check I get a following warning : no visible global function definition for ‘biocLite’ I have used biocLite to load a user defined library from within a function if that library is not pre-installed if(is.element(annotpkg, installed.packages()[,1]) == "FALSE"){ source("http://www.bioconductor.org/biocLite.R") biocLite(annotpkg) library(annotpkg,character.only=TRUE) } Should I ignore this error or there is a workaround for the warning. My package is working fine though still I guess the warning has to have significance. Please help in clarifying this warning. [[alternative HTML version deleted]]
• 1.1k views
ADD COMMENT
0
Entering edit mode
@henrik-bengtsson-4333
Last seen 7 months ago
United States
NOTEs can be ignored and are sometimes false positives. If I want to get rid of it, a workaround that I use is: # To please R CMD check biocLite <- NULL; rm(biocLite) source("http://www.bioconductor.org/biocLite.R") biocLite(annotpkg) Similar code-check NOTEs occurs when you for instance load objects, attach a data frame etc, e.g. df <- data.frame(a=1, b=2) attach(df) # To please R CMD check a <- b <- NULL; rm(a, b) x <- a + b /Henrik On Fri, May 6, 2011 at 2:20 AM, swaraj basu <projectbasu at="" gmail.com=""> wrote: > Dear All, > ? ? ? ? ? ? I am trying to build a package for a set of functions. ?I am > able to build the package and its working fine. When I check it with > ? ? ? ? ? ? R CMD check > > ? ? ? ? ? ? I get a following warning : ?no visible global function > definition for ?biocLite? > > ? ? ? ? ? ? ?I have used biocLite to load a user defined library from > within a function if that library is not pre-installed > > ? ? ? ? ? ? if(is.element(annotpkg, installed.packages()[,1]) == "FALSE"){ > ? ? ? ? ? ? ? source("http://www.bioconductor.org/biocLite.R") > ? ? ? ? ? ? ? biocLite(annotpkg) > ? ? ? ? ? ? ? library(annotpkg,character.only=TRUE) > ? ? ? ? ? ? } > > ? ? ? ? ? ?Should I ignore this error or there is a workaround for the > warning. My package is working fine though still I guess the warning has to > have significance. Please help in clarifying this > ? ? ? ? ? ?warning. > > ? ? ? ?[[alternative HTML version deleted]] > > > _______________________________________________ > 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 >
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 3 months ago
United States
IMHO you should not be sourcing/calling biocLite in this way. You could use require(annotpkg, character.only=TRUE) (I think) and issue an error if it fails, indicating to the user that they need to install annotpkg and, if you like, suggesting to them that they use biocLite. There are other packages that do real-time installation of, for example, CDFs, when such are lacking, so your approach has precedents, but I believe that embedding automatic software installation in user applications causes more headaches than it remedies, particularly when missing packages are large or not properly detected, or network connectivity is lacking. Furthermore I believe this message on visible global is not a warning but a NOTE. warnings must be eliminated from released packages but NOTEs are not required to be eliminated ... for the moment. On Fri, May 6, 2011 at 5:20 AM, swaraj basu <projectbasu at="" gmail.com=""> wrote: > Dear All, > ? ? ? ? ? ? I am trying to build a package for a set of functions. ?I am > able to build the package and its working fine. When I check it with > ? ? ? ? ? ? R CMD check > > ? ? ? ? ? ? I get a following warning : ?no visible global function > definition for ?biocLite? > > ? ? ? ? ? ? ?I have used biocLite to load a user defined library from > within a function if that library is not pre-installed > > ? ? ? ? ? ? if(is.element(annotpkg, installed.packages()[,1]) == "FALSE"){ > ? ? ? ? ? ? ? source("http://www.bioconductor.org/biocLite.R") > ? ? ? ? ? ? ? biocLite(annotpkg) > ? ? ? ? ? ? ? library(annotpkg,character.only=TRUE) > ? ? ? ? ? ? } > > ? ? ? ? ? ?Should I ignore this error or there is a workaround for the > warning. My package is working fine though still I guess the warning has to > have significance. Please help in clarifying this > ? ? ? ? ? ?warning. > > ? ? ? ?[[alternative HTML version deleted]] > > > _______________________________________________ > 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 >
ADD COMMENT

Login before adding your answer.

Traffic: 543 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