[R-pkg-devel] Installing conda dependecy onAttach

Michael Gruenstaeudl gruen@t@eud| @end|ng |rom zed@t@|u-ber||n@de
Fri Jun 14 11:04:12 CEST 2019


Assume an R package (`myRpackage`) that has a conda package 
(`condaDependecy`) as a system requirement. The file `DESCRIPTION` of 
the R package would read like:

     Package: myRpackage
     ...
     SystemRequirements: condaDependecy (>= 0.1)
     ...

How can I ensure the automatic installation of this condaDependecy (i.e. 
`conda install condaDependency`) upon installing the R package itself 
(i.e. `install.packages("myRpackage")`), assuming that myRpackage is 
listed on CRAN?

I would prefer a method less "clunky" as

     .onAttach = function(libname = find.package("myRpackage"), pkgname 
= "myRpackage") {
         system("conda install -y condaDependency")
     }



More information about the R-package-devel mailing list