Hi all, 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? 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 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. Titus -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 472 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-package-devel/attachments/20160123/434211c7/attachment.bin>
[R-pkg-devel] Packages that depend on third-party binaries
4 messages · Duncan Murdoch, Dirk Eddelbuettel, Titus von der Malsburg
On 23/01/2016 6:12 PM, Titus von der Malsburg wrote:
Hi all, 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? 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 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.
Examples of packages like that are RGtk2 and rjags (for either or both of which I might have the capitalization wrong). You need to be sure your examples don't fail whether or not the externals are available. I think both of those packages list the external dependencies in DESCRIPTION, and refuse to load if the dependencies aren't present. So then the examples should all work. Another approach is to include a function that tests for the presence of the externals, and only runs the examples when they will work. You shouldn't include examples that fail. I don't know if CRAN will accept your package if it is hard to obtain the external software because of license issues. So you might think about distributing such a package to your colleagues and others by a less careful channel, e.g. Github. I tell my students *never* to use packages unless they are on CRAN, but you may have no choice. Duncan Murdoch
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
Thank you, Dirk and Duncan. I think I will go the same route as the current seasonal package then. In my case, I can expect users to be able to install the binary by themselves. The license of the binary may also prevent us from doing anything more than that. Duncan, according to ?Writing R Extensions?, the field SystemRequirements can be used to list external dependencies but I gather that the content of this field is purely descriptive and that the dependencies listed in it are not enforced by R. Thanks again. Titus
On 2016-01-23 Sat 15:55, Dirk Eddelbuettel wrote:
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