I'd like to put a package onto CRAN. However, the package currently uses an external C model (ISDA Standard model), which is created under public re-distributable license. However, the CRAN administrator refuses to put the package on CRAN if it contains this C model. So is there anyway to put the package onto CRAN without this C model, and when calling install.packages("my.package")
, it can automatically download the C model from github.com/my_github?
For now, I wrote the following code in zzz.R
:
.onLoad <- function(libname, pkgname) {
if ( ! "Github_pkg" %in% (all.available = TRUE)){
devtools::install_github("myGithub/Github_pkg")
}
}
Is this okay if I submit to CRAN? Or should I use drat
package by Dirk? Thanks!!
You can install multiple packages by passing a vector of package names to the function, for example, install. packages(c("dplyr", "stringr")) . That function will install the requested packages, along with any of their non-optional dependencies.
You can look into my drat package to create your own repository on GitHub. I use that for example to host the Rblpapi package I contribute to (and which relies on a library from Bloomberg) in this ghrr repository built using drat.
This all works. CRAN has even accepted a package which used the ghrr drat repo as an external repository (but since removed that package for another reason).
You still need to organize your "primary" package on CRAN in such a way that the "secondary" package is only a "Suggests:" as actual dependencies must be on CRAN too. But at least this gives you a way to automate these processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With