[R] R/C programming and documentation---thanks and summary

Jonathan Myles jonathan.myles at mrc-bsu.cam.ac.uk
Mon Jun 7 10:52:50 CEST 1999

Thanks to everyone who helped with my query---Professors
Riply, Bates, Lumley, and Tim Keitt.

I said 


> My worries are
> a) That I've used calloc rather than S_alloc throughout.

Professors Bates and Ripley both pointed out that calloc
should be replaced by Calloc and free by Free, 
which, I'll do.

I said:

> b) That I've used the following technique: I've
>    calls to different C programs held together in a single
>    file which looks like:
>       GLM g;  /* information about the model */
>       OUTPUT o; /* information about the output *
>       f1(g){ ....... }
>       f2(g,o) { ......}

Professor Ripley pointed out that the g and o arguments are 
unneccesary. (I don't have them in my code, but put them in
my incompetent attempt to provide an illustrative example.

The consensus was that this way of programming 
seems to be not ideal, but acceptable. A better long-term
alternative would be to use the .External statement which is 
similar to the .Call in S-plus v5 (NOT S v5, as I said), for which
Professor Bates kindly offered an early peek at some documentation.

I propose to make the version of my library which uses the above 
technique available (soon!) and to later replace it with a new version using
the .Call function. 


I said:

> On another note, where in the library structure would be a good     
> place to put a LaTeX document describing the function and showing
> some examples?

I didn't make it clear that this was in addition to the .Rd files
in my /man subdirectory.  I shall put the document as a .ps file 
in a /doc subdirectory at the same level as /man, /src etc.


Thanks again to everyone who helped,


Dr. Jonathan Myles         e-mail:jonathan.myles at mrc-bsu.cam.ac.uk
MRC Biostatistics Unit     Tel. 01223 330371
Institute of Public Health FAX  01223 330388
University Forvie Site
Robinson Way
CB2 2SR                   
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list