[Rd] R CMD check warning "no visible binding for global variable" and hasArg()

Dr. Peter Ruckdeschel peter.ruckdeschel at itwm.fraunhofer.de
Fri Aug 22 15:48:14 CEST 2008


Hi R-devels,

latetely I reported having problems with understanding warnings
issued by a devel version of R CMD check, which Brian Ripley in
his reply

     https://stat.ethz.ch/pipermail/r-devel/2008-August/050493.html

correctly attributed to my using an outdated version (July 29)
--- you really have to be quick with updating these days!

Having switched to a more recent version, R CMD check indeed
no longer issued these warnings and instead helped me to detect
some missing bindings for global variables --- thank you Kurt for this!
 
In some occasions the warning  "no visible binding for global variable XY"
seems overly fuzzy to me, however:

R CMD check also issues this warning, if, by means of function hasArg()
from
package 'methods', I want to test the presence of a certain argument 'x'
in a
function call when 'x' is not a formal argument but "..." is.
Clearly, then 'x' in general will have no binding.

I am not sure whether this is of general interest, but I think it should not
be too difficult to check whether this "missing binding" occurs within a
call
to hasArg() [and then not to issue the warning].

Thanks for listening,
best regards, 
Peter

-- 
Dr. Peter Ruckdeschel, Abteilung Finanzmathematik, F3.17
Fraunhofer ITWM, Fraunhofer Platz 1, 67663 Kaiserslautern
Telefon:  +49 631/31600-4699
Fax    :  +49 631/31600-5699
E-Mail :  peter.ruckdeschel at itwm.fraunhofer.de




More information about the R-devel mailing list