therneau/survival

C symbol name "coxfit6" not in load table

Closed this issue · 1 comments

Hello, I recently updated my R to R version 4.1.2 and survival 3.3-2.
Previously I try to call coxfit6 in a function definition using the below code

.Call("coxfit6", as.integer(maxiter), time, stat,
x, offset,weights,newstrat,
as.integer(method == "efron"),eps,
toler.chol, init, as.integer(1))
}

Now it shows an error message: C symbol name "coxfit6" is not in the load table. coxfit6 is in the src folder.

Can you please tell me how I can call coxfit6 in R? Thanks!

The survival routines use name registration: see section 5.4 of the manual "Writing R Extensions". Doing so was strongly encouraged by R-Core, since survival is used by so many other packages. You can look at the first few lines of the NAMESPACE file, and at src/init.c to find the various choices that were made. Remember that since my C routines are not designed to be called by others, there is no implied guarantee that the calling arguments or return values will remain the same. If you have a compelling case for calling the C code directly, we may have to build that into the survival package itself, per section 5.4.3.
Also, note that all of the survival package was put under the lesser Gnu license, on purpose. You can always make a local copy of coxfit6 and include it in your own library; just put a comment line at the top acknowledging where you got it.

For my information, why do you need/want to call the C code?