Re: [R] Building R packages under Windows.

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 11 Apr 2005 - 22:15:07 EST

On Apr 11, 2005 2:58 AM, Duncan Golicher <dgoliche@sclc.ecosur.mx> wrote:
> Hello,
>
> My question is the following. Has anyone put together an "idiots"
> checklist of the steps needed to build a (small personal) package under
> Windows, or documented their own experiences of building packages under
> Windows?
>
> I ask this as last week there were some very interesting comments
> regarding the advantages of putting personally written functions
> together as a package rather than sourcing them in at the start of a
> session using .Rprofile. They inspired me to try to build my own package
> for a few functions I use in teaching on my laptop running Windows XP .
> I read and reread "Writing R extensions" I installed Pearl and tried
> build on a modified package.skeleton. I fairly quickly worked out I
> needed to do things like setting Tmpdir as an environment variable, but
> then I got stuck and frustrated and gave up. I'm sure that with more
> time I would get things working, but I don't have more time. Could the
> process be made smoother through better documentation? This may sound
> like laziness, but I do guess that there are others are in the same
> position who find that the initiial hassles of building a package (under
> Windows) leads to a negative cost benefit balance over less elegant
> solutions.
>
> Thanks,

Other resources are:

- http://www.murdoch-sutherland.com/Rtools/
- README.packages in \Program Files\R\rw2001 or whatever version of R
- posts by me, John Fox, Andy Liao in r-help or r-devel

I use Windows XP and it also took me quite a bit of time until I figured it out too. I was really wondering as I got frustrated how it was possible that 500+ packages got developed for R when it was so hard to figure out how to create a package, particularly if you want to put in a vignette. One of the problems is that its dependent on so many other pieces of software and also there can be path problems that you have to figure out. I suspect that the process is somewhat smoother under UNIX and maybe most people use that.

Fortunately, it does all work once you get it figured out and its worth it if you are going to do a lot of development since it really helps organize you. If you are just going to use it briefly or casually its probably not worth the hassle. Once you do figure it out it does work although there are a few annoyances. R CMD CHECK is really great although I wish there were some way of telling it to ignore the files referenced in .Rbuildignore so one does not have to do a build first. Also the error messages from the process are often less than helpful but I suspect it would be difficult to improve since it can go wrong at a point which is different than the source of the problem.

I think the fixable problems are:
- a guide is needed, as you mention
- the prerequisites need to be reduced:


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Apr 11 22:29:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:06 EST