[R-pkg-devel] Packages that depend on third-party binaries

Dirk Eddelbuettel edd at debian.org
Sun Jan 24 00:55:06 CET 2016


Titus,

On 23 January 2016 at 15:12, Titus von der Malsburg wrote:
| I have a package that might be useful for a lot of my colleagues.  It
| provides functions for reading a binary file format generated by
| measurement instruments by a specific manufacturer.  Eventually, I would
| like to make this package available on CRAN.
| 
| One problem is that this package uses a binary blob provided by said
| manufacturer.  I understand that it is not allowed to include binaries
| in R packages.  The question is, what else can I do?  Are there any
| recommendations or best practices that one should follow in this
| situation?  Any example of existing CRAN packages that deal with this
| problem?

We just released the 'x13binary' package to CRAN for this.

It provides the X-13ARIMA-SEATS seasonal adjustment program provided by the
US Census for use by other programs -- notably Christoph Sax's (excellent)
'seasonal' CRAN package (see also the very pretty http://www.seasonal.website ).

The 'x13binary' package downloads suitable binaries we fetch at build time
from the corresponding 'x13prebuilt' repo.  Both the source for 'x13binary'
and these 'x13prebuilt' binaries are inside the http://github.com/x13org repo
Christoph and I set up.

Now X-13ARIMA-SEATS is a special case. US Government works cannot be
copyright in the US, so distribution here is fine -- but for other countries
it is murky because it is a bit of a non-standard license.  CRAN and I went
back and forth for a few days on this.  But that package is now out there.
We are currently awaiting the processing of 'seasonal' from incoming at CRAN
which should hopefilly get through 'soon'.  Once it is, I plan to release a
(small) package using 'seasonal' (and hence 'x13binary' / X-13ARIMA-SEATS) to
redo something (in a package) the NY Times recently did with (and for which
they released non-package code).

Now, for your 'binary blob from said manufacturer' the license may well
prevent upload to CRAN.  You can, however, have CRAN use a Suggests: to a
third-party repo -- for which you could use small repo (maybe even created
and managed with my 'drat' package -- there are precedents) and then have the
off-CRAN package deal with the blob.
 
| I suppose one solution would be that the R code installs without the
| binary but warns when the user tries to use it without having installed
| the binary.  In this scenario, it would be the user’s responsibility to
| make sure that the binary is correctly installed.  If the user fails to

That is exactly what 'seasonal' versions up to 1.1 (currently on CRAN) did.

Now we are trying to do one better to automate this because here we can (or
so we think -- given the license).  We think it would be a boost for
'X-13ARIMA-SEATS' use which is why the did this work in the first place.

| do that, the package is completely useless.  Of course this also has
| implications for the sample code in the man pages which is not
| guaranteed to work and will certainly not work on CRAN build servers.

Hope this helps, regards, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-package-devel mailing list