[Rd] Packages of snippets? (was: A way to list only variables or functions?)

Duncan Murdoch dmurdoch at pair.com
Thu Jun 24 03:31:56 CEST 2004

[Moved from r-help to r-devel]

On Thu, 24 Jun 2004 09:29:12 +1200, Patrick Connolly
<p.connolly at hortresearch.co.nz> wrote:

>I made myself a function in the S-PLUS days which I've modified to
>work in R.  It involved adding another few functions to add dates to

This isn't something I'd use, since I prefer to keep objects in source
form, but I bet there are quite a few people who would use it if it
were generally available.

>I've toyed with the idea of adding an object size column but it's not
>important enough for my use.  Since I revisit projects over a period
>of years at times, the date is very useful information -- in fact,
>it's the main reason why I wrote it.
>My code is not elegant enough for an esteemed place on CRAN.  I could
>make it a lot better myself if I spent the time on it, but it works
>well enough for me as it is, so in that sense, it ain't broke.
>However, if anyone is interested in having such functionality my code
>could be a good starting point.

Inelegance is no excuse!  However, I do understand the feeling of
writing a nice little function, and not knowing exactly what to do
with it:  CRAN is crowded, and it does seem that an entire package
just to support one or two simple functions is a bit of overkill.

Can we work out a way to publish such things?  Here's a proposal, with
some serious flaws listed below.  Can someone fix them?

 - It should be easy to publish a short article describing your nice
little function, and making the code available to others.  (I think
this is already in place, either by publishing in RNews or Journal of
Statistical Software, as a code snippet.)

 - It should be easy for users to get it, together with man pages,
etc.  This is not in place, unless you package your function and send
it to CRAN.  What I'd propose is that a volunteer should act as an
editor of an "RNews" or "JSS" package, that contains *all* of the
snippets that have been published in RNews or JSS.

Some major flaws in this proposal are:

 - It needs a volunteer editor.

 - The editor would have to be organized, and willing to bug authors
for updates whenever R changes and breaks their snippet (or makes it
obsolete).  If there's no one willing to do this, the editor should
feel free to drop the snippet from the package.

 - There'd have to be a way for someone to see which snippets don't
have maintainers so have been dropped, but could be resurrected.

 - If it's successful, there'll be name clashes.  The editor should
try to head these off from the start, by setting some rules for what
kinds of names should be used for internal functions, and what public
names should look like.

 - There aren't actually that many snippets being published, because
it's hard work to convert something that works "well enough for me" to
something we'd like others to see.

Duncan Murdoch

More information about the R-devel mailing list