[Rd] clarification on import/depends for a method

Therneau, Terry M., Ph.D. therneau at mayo.edu
Mon Mar 2 15:45:39 CET 2015

User of the coxme library (mixed effects Cox models) are instructed to use ranef(), 
fixed(), VarCorr(), etc to retrieve bits out of a fitted model; it purposely uses the same 
methods as nlme and/or lmer.

The current behavior is to "depend" on nlme.  If I defined the methods myself in coxme, 
then someone who had both nlme and coxme loaded will suffer from "last loaded wins", and 
the methods for one or the other are not found.  I'm willing to update this but want to 
get it right.  The import(nlme) +  nlme::ranef(fit) solution is not appealing.  I don't 
mind putting :: in my source code, but users of the package should not be forced into this.

Is the correct current solution (using ranef as an example)
    importFrom(nlme, ranef)

then use promptImport() to create a manual page?

If users always had only one of coxme, lmer, or nlme loaded in any given session then 
there are multiple solutions, but occassionally one wants both linear and Cox mixed effects.

Terry T.

More information about the R-devel mailing list