[R-pkg-devel] Including Open-Source C Code in R Package

Duncan Murdoch murdoch.duncan at gmail.com
Wed Aug 5 19:34:39 CEST 2015

On 03/08/2015 2:54 PM, Zhu, Zijie wrote:
> Hi all,
> I would like to submit a package to CRAN. Now my package includes an
> open-source C model released by some other institution. This
> open-source C model is published under some public license that is not
> in the complete list that CRAN considers valid (link to the list:
> https://svn.r-project.org/R/trunk/share/licenses/license.db)
> Last time I tried to submit the package containing this C model to
> CRAN, but they rejected because of the license problem. Therefore, I
> would like to know if the following is possible, or what is the best
> practice:
> 1. Can I include the open-source C model in my package, in a way that
> can get around the license issue?
> 2. Or, if the above is not feasible, I can split the package in
> halves. Is it possible that I submit "Part A" to CRAN and put "Part B"
> on Github, and when calling `install.packages("Part A")`, "Part B"
> will also be fetched and installed from Github? Currently I have the
> following piece of code in "Part A" to do this:
> .onLoad <- function(libname, pkgname) {
>   if ( ! "Part B" %in% .packages(all.available = TRUE)){
>     devtools::install_github("myrepo/Part B")
>   }
> }
> Is this acceptable to CRAN maintainer, or what is the best practice?

I don't think so --- how could anyone use your package, if it is incomplete?

You should get permission from the authors of the other package to
release it under one of the allowed licenses.  Or distribute the whole
thing on Github, or some other non-CRAN location.

Duncan Murdoch

More information about the R-package-devel mailing list