[Rd] no visible binding for global variable for data sets in a package

Therneau, Terry M., Ph.D. therneau at mayo.edu
Thu Aug 28 15:49:29 CEST 2014


Here is one rationale for the change, which was useful for my understanding

This arises in the survival package in the survexp function:
     survexp <- function(formula, data, weights, subset, na.action,.... ratetable=survexp.us)

The argument has been changed to survival::survexp.us, soon to be uploaded to CRAN.

Assume that a user has an object named "survexp.us" in their working data, and calls 
survexp without providing a ratetable arguement.  Should they get the package default or 
their own object?  I'd vote for the first, but the current behavior is the latter.  This 
was presented to me as "fixing a bug that has long been present, but we never noticed before."

Now, if the user adds "ratetable=survexp.us" to the call they should get their own 
object.  I've always hated computer systems that ignore explicit direction, assuming they 
know more than me.

Terry Therneau



More information about the R-devel mailing list