[R] Seeking Packaging advice
ross at biostat.ucsf.edu
Tue Aug 26 22:58:26 CEST 2003
I have two questions about packaging up code.
1) Weave/tangle advisable?
In the course of extending some C code already in S, I had to work out
the underlying math. It seems to me useful to keep this information
with the code, using Knuth's tangle/weave type tools. I know there is
some support for this in R code, but my question is about the wisdow of
doing this with C (or Fortran, or other source) code.
Against the advantage of having the documentation and code nicely
integrated are the drawbacks of added complexity in the build process
and portability concerns. Some of this is mitigated by the existing
dependence on TeX.
An intermediate approach would be to provide both the web (in the Knuth
sense) source and the C output; the latter could be used directly by
those not wishing to hassle with web. This isn't ideal, since the
resulting C is likely to be a bit cryptic, and if someone edits the C
without changing the web source confusion will reign.
So do people have any thoughts about whether introducing this is a step
forward or back?
2) Modifications of existing packages.
I modified the survival package (I'm not sure if that's properly called
a "base" package, but it's close). I know in this particular case, if
I'm serious, I probably should contact the package maintainer. But this
kind of operation will probably be pretty common for me; I imagine many
on this list have already done it. In general, is the best thing to do
a) package the new routines as a small additional package, with a
dependence on the base package if necessary (the particular change I've
made actually produces a few distinct files, slight tweaks of existing
ones, that can stand on their own)
b) package the new things in with the old under the same name as the old
(obviously requires working with package maintainter)
c) package the new things with the old and give it a new name.
I'm also curious about what development strategy is best; I did b), and
it seemed to work OK. But I kept expecting it to cause disaster (it
probably helped that I usually didn't load the baseline survival
packages; clearly that wouldn't be an option if working with one of the
automatically loaded packages).
Ross Boylan wk: (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4 ross at biostat.ucsf.edu
Dept of Epidemiology and Biostatistics fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840 hm: (415) 550-1062
More information about the R-help