[R] R CMD build --binary without option --use-zip-data

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Aug 21 18:07:47 CEST 2010

I believe this is specific to Windows, which you have nowhere 
mentioned.  And the preferred way to make a binary package there (see 
'Writing R Extensions') has long been R CMD INSTALL --build and not R 
CMD build --binary.  So this is really a question about R CMD INSTALL 
--build: --use-zip-data is an option to 'INSTALL' and not to 

There have been substantial recent changes in the R CMD utilities and 
more will be coming in R 2.12.0.  So I am going to answer this as if 
it were about R 2.11.x on Windows, but it would have been courteous to 
let us know (as the posting guide asks).

On Fri, 20 Aug 2010, Andrew Liu wrote:

> Hello,
> When I run
> R CMD build --binary pkgname
> I get
> * checking for file 'pkgname/DESCRIPTION' ... OK
> * preparing 'pkgname':
> * checking DESCRIPTION meta-information ... OK
> * cleaning src
> * removing junk files
> * checking for LF line-endings in source and make files
> * checking for empty or unneeded directories
> * building binary distribution
> * installing *source* package 'pkgname' ...
> Using auto-selected zip option '--use-zip-data'
> and so on.
> Is there anyway to have R CMD build not use the zip option '--use-zip-data'?

In 'Writing R Extensions' I see in section 1.1.1:

   The optional `ZipData' field controls whether the automatic Windows
   build will zip up the data directory or no: set this to `no' if your
   package will not work with a zipped data directory.

That seems to be the answer to your question.

> Alternatively, I have a text file in the \data folder called "sample.txt" and 
> I want users to be able to get the filename by typing
> filename <- system.file("data", "sample.txt", package = "pkgname")
> which they cannot do if it gets zipped. Is there a workaround?

That's not really what the 'data' directory is for: if you want to 
provide data in any form other than for use by data(), please use a 
different subdirectory ('extdata' or 'datasets' are two I have seen 
used).  Again, see Writing R Extensions section 1.1.5.

> Thanks,
> Andrew
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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