[R] Building package on Windows

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed May 16 03:59:31 CEST 2007

On Tue, 15 May 2007, Eglin, Jason wrote:

> Hello,
> I have been trying to build a package for R to use on windows.  I have
> been able to build it with out problems except for one thing.  I am
> creating a zip file to be installed by the R gui.
> I have four directories under the main dir.  I have data, man, R, and
> src.  The problem that I have been having, is that the data directory is
> being zipped up, then when I  install the package the data directory
> isn't being unzipped when using the gui (This is the main way many of
> the users that I work with use R).  When I make my call to build the zip
> fill it looks like the following:
>>> R CMD build --binary  --use-zip-help --docs=normal batdebug
> I have taken out the --use-zip-help flag and I still created the zipped
> data directory.  I have three items in the data directory, a config file
> and two java files that are invoked by a dll that is in the src
> directory.  The three files in the data directory is about 1,200 KB in
> total size.
> I have R 1.9.1 installed to build with because it doesn't zip up the
> data directory like the current version of R.

Packages installed under 1.9.1 will be unusable under current R.

> I have looked into the R documentation to find if I am not using a flag 
> or something.  I have tried the --auto-zip and --use-zip-data flags and 
> neither of these flags did anything different.
> I have been experiencing this problem with R 2.4.1 ( I have tried with
> several other versions of R and they all do the same thing since 2.0.0.)
> Can anyone point me in the correct direction of a flag to include or how
> to fix this problem.

Not use the data directory for non-R data?  R is perfectly capable of 
unzipping the data for its own use.  As 'Writing R Extensions' says

  The @file{data} subdirectory is for additional data files the package
  makes available for loading using @code{data()}.  Currently, data files
  can have one of three types as indicated by their extension: plain R
  code (@file{.R} or @file{.r}), tables (@file{.tab}, @file{.txt}, or
  @file{.csv}), or @code{save()} images (@file{.RData} or @file{.rda}).

You could for example install via the inst directory.

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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list