[R] survival package can't find Ccoxfit6

Therneau, Terry M., Ph.D. therneau at mayo.edu
Thu Apr 27 14:29:31 CEST 2017

  Let me summarize rather than repeat the entire thread:

An error report from a user (seshan) stumped me, and I asked for help here.

Duncan Murdoch picked up on fine details of the error message, i.e., that the error did 
NOT come from within the survival package.  That changes the whole tenor of the discussion.

Indeed, the user has their own function "phcoefs" that directly calls one of my internal C 
routines.  As of R 3.4, this can only be done for routines that I explicitly export.   I 
don't export coxfit6.c.

Where to go from here?

1. I'm not against exporting a routine, but I'm not going to do it without a discussion.  
Doing so is more work for me: I'd need to write a test routine in order to ensure 
long-term reliability of the export, and it ties my hands wrt future changes.  In this 
partiuclar case, why not use coxph.fit?

2. One of the design goals for the survival package is to make it usable as a component 
for other's work.  For instance all of the return structures are easily inspected (no S4 
classes) and most are carefully documented e.g. help(coxph.object).  The core computations 
of coxph are split out into separate functions coxph.fit and agreg.fit, so that they can 
be called directly without the formula and argument checking overhead.  Ditto for survreg, 
survifit, survdiff and concordance.  Given the number of other packages that depend on 
survival I have been at least moderately successful at this aim.  (To be honest this is 
not entirely alturism on my part as it stops the near infinite requests to add one 'just 
one more thing' to the package.)  This also means I am open to modifying a routine or 
exporting a call -- if you can make a good argument.

3. I need a good way to document this for the survival package. Yet one more chapter in my 
1/2 written book. Someday...

4. Calling another package's C routines is dangerous, and one of the goals of the 3.4 
namespace changes was to stop this from happening willy-nilly.  The new error messages 
look like success.   Though it means that I'm getting multiple "not found" emails.

Terry T.

More information about the R-help mailing list