[Rd] R CMD check tells me 'no visible binding for globalvariable'

Therneau, Terry M., Ph.D. therneau at mayo.edu
Fri Apr 16 16:16:02 CEST 2010


Henrik wrote: 

I think what people are also thinking about is that the policy for
publishing a package on CRAN is that it have to pass R CMD check with
no errors, warnings *or* notes.  So, in that sense notes are no
different from warnings.
---------------------------------

Getting rid of these notes would be very hard in the survival package.
The population survival routines (survexp, pyears) that have to deal
with dates try to be very accommodating wrt the date format the user
chose, so have constructions like
   if (user date looks like a chron object) {
         calculation using chron functions
         }
   else if (is from the date package) {
        use mdy.date }
   else if (Date object)

etc

   Most of the functions inside the {} cause a warning note because of
course the necessary packages for each case are not present when
survival is built.  Since we deal with medical studies that span
multiple years or even decades, I and others in my group benefit
directly from this date handling: it was not added solely from a
humanitarian impulse.
   
  It's a minor nuisance, since I have to read through the messages after
each build to see if something I actually do need to worry about turns
up.  It has happened, in which case I'm thankful for the message.
(Although it would be nice if there were a way to generate more context.
Once one was for an undefined variable 'n', which was not easy to find
using a text editor.)

Terry Therneau

   



More information about the R-devel mailing list