[R] R Package Building Question

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu Mar 2 08:01:33 CET 2000

On Wed, 1 Mar 2000, Thomas Lumley wrote:

> On Wed, 1 Mar 2000, Brett Presnell wrote:
> > 
> > 1. If this file is named R/sta4504 (with no extension), then when I
> > build the package (under Solaris), create a zip file and install the
> > package on a Windows PC, it works fine.  However, under Solaris,
> > R INSTALL sta4504 hangs and does not complete the installation of the
> > package.

I don't think you *install*ed on Windows. I think you unpacked it.
(To install it, you use make pkg-sta4504.)

> > 2. If this file is named R/sta4504.R, then the package installs and
> > works fine on the Solaris machine, but the same package is not
> > recognized as even existing by R under Windows.

Did you *install* it under Windows, or did you just plonk it in the
library directory?

> > I notice that most (all?) of the contributed packages leave off the
> > extension, in spite of the advice to the contrary (at least to my
> > reading) in Section 1.1.3 of "Writing R Extensions", and they all work
> > on both platforms.  I don't remember ever seeing this come up on the
> > list, so what am I missing?
> What you're missing is that Unix packages are source code and Windows
> packages are compiled. It's less obvious when there isn't any C or Fortran
> code.  This is because typical Windows installations lack not only
> compilers for C and Fortran but also the tools to process help pages.
> In source form the package/R directory contains one or more files with
> extensions .R (or .r, .q or various other possibilities), the package/src
> directory has C or Fortran source code, package/man has .Rd files.
> In compiled form package/R has a single file whose name is the name of the
> package, the /src subdirectory is replaced by a /libs subdirectory with a
> shared library, the /man subdirectory is replaced by one or more
> subdirectories with various compiled help files.
> So, sta4504.tgz should be a source package, with extensions, sta4504.zip
> should be a compiled package, with no extensions.  There would be other 
> differences if you had help pages for the functions.

Another way of putting this. What goes in the R_HOME/library directory
on either platform is an installed package. What is distributed in the main
CRAN directory is source packages.  What is in the Windows-NT/contrib
directory is a dump of an installed package, not a source package.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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