[R] Including .exe files in an R package

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Feb 13 19:06:40 CET 2012


On 13/02/2012 17:15, sahir bhatnagar wrote:
> I am in the process of creating a package in R which calls
> pre-compiled C code i.e. '.exe' files

Which are only used on Windows, so presumably you forgot to mention that OS.

> In reading the manual, I came across this:
>
> "A source package if possible should not contain binary executable
> files: they are not portable, and a security risk if they are of the
> appropriate architecture. R CMD check will warn about them2 unless
> they are listed (one filepath per line) in a file ‘BinaryFiles’ at the
> top level of the package. Note that CRAN will no longer accept
> submissions containing binary files even if they are listed."
>
>> From my understanding, the .exe files are a subset of binary files,
> which are no longer accepted by CRAN. If this is the case for my
> situation, is there any other way to include the C code, so that CRAN
> will accept the package?

CRAN will neither accept packages with binary code files, nor will it 
accept packages tied to one architecture and OS (as such files would 
be).  You can do what you like provided you do not want to distribute 
the package: at that point you need to meet the conditions of the 
license and of the repository.

There are several examples of CRAN packages which compile up 
executables: arulesSequences is one.  But note that this is tricky as 
platforms such as Windows and OS X support multiple architectures in the 
same package installation.

> thanks
>
> ______________________________________________
> 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.

And that does make clear that this is (or would rapidly become) a 
R-devel topic.

-- 
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