[R] Creating a minimal package

Berton Gunter gunter.berton at gene.com
Mon Jul 12 19:31:39 CEST 2004


Without entering the debate, just a little addendum to Andy's suggestions and
Duncan's and Gabor's comments about the difficulty of building (simple,
containing no binaries and just a few functions) packages for R.

I have for some time now built such R-code only .rda files. It is a trivial
matter to automatically attach them at startup (through .Rprofile, .First, or
other startup options) so that they are then "transparently" available for use. I
have also found it to be a simple matter to bundle such customized bunches of
functions for "naive" users into a little UI so that they click on a desktop icon
and R opens with the necessary functions and data (and maybe even prompts them,
etc.). You could get quite fancy with this with TK-type stuff, but I haven't
found it necessary to do this.

Please note: I know this is only for small stuff, risks clashes because the
function names are global variables, is not for general distribution, etc.
However, in the "Pareto Principle" spirit or doing things simply when that
suffices, I have found such quick and dirty approaches quite useful. Why bang
your head on a wall if you don't need to?


"Liaw, Andy" wrote:

> BTW, for functions/objects that you would like to use over and over, but do
> not want to go through the hurdle of packaging, there's a fairly simple way
> to achieve similar effect: save all of them in a .rda file, and when you
> need them, just attach() the .rda file.
> Andy
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Bert Gunter

Non-Clinical Biostatistics
MS: 240B
Phone: 650-467-7374

"The business of the statistician is to catalyze the scientific learning

 -- George E.P. Box

More information about the R-help mailing list