[Rd] Registering native routines

Terry Therneau therneau at mayo.edu
Fri Feb 22 20:59:50 CET 2013


I'm working on registering all the routines in the survival package, per a request from 
R-core.  Two questions:

1. In the coxph routine I have this type of structure:
      if (survival has 2 columns) routines <- c("coxfit5_a", "coxfit5_b", "coxfit5_c")
         else                     routines <- c("agfit5_a",  "agfit5_b",  "agfit5_c")

.....

     .C(routines[1], arg1, etc

I tried replacing "routines" with a vector of native symbol references, but it doesn't work

Error in .C(routines[1], as.integer(n), as.integer(nvar), as.double(y),  :
   first argument must be a string (of length 1) or native symbol reference

I had fixed up all the other .C and .Call statements first (28 of them) and that worked, 
so the problem is not with finding the set of symbol references.

2. In the R-exts manual it mentions another argument "style" for C calls to specify if an 
argument is for input, output, or both.  However, I can find no details on how to use it.

3. A few of my routines still had a COPY argument.  I assume that is simply ignored?

Terry T.

R Under development (unstable) (2013-02-11 r61902)
Platform: i686-pc-linux-gnu (32-bit)



More information about the R-devel mailing list