CredibilityLab / groundhog

Reproducible R Scripts Via Date Controlled Installing & Loading of CRAN & Git Packages
https://groundhogr.com/
GNU General Public License v3.0
78 stars 4 forks source link

Handle packages like ROracle that have newer versions hosted elsewhere #99

Closed j-tafoya closed 7 months ago

j-tafoya commented 1 year ago

Oracle produced a version of ROracle 1.3-2 that is newer than that on CRAN, which must be installed manually. Every time I run groundhog.library() with ROracle included, it tries to download the latest from cran and replace the newer version, but fails because of other unrelated reasons (ROracle is notoriously difficult to install and has to be installed with special flags pointing to dlls). I want to keep ROracle in the library list with other packages, hoping that groundhog would recognize that it is installed with a version greater than that in CRAN and ignore it.

Any advice other than keeping ROracle outside of the groundhog.library() call?

Thanks!

urisohn commented 1 year ago

This can't be done. If groundhog were to take into account what you have installed to decide what to do it would cease to help generate reproducible code. Instead, i would just have in your code a line that installs ROracle in a dynamic way so that when people run this in the future they will try to load the same version; now, if you have packages that depend on ROracle and you want to be able to use those, while using the more recent version of ROracle, then, you can do that.

Say pgkA depends on ROracle, then you'd run

groundhog.library('pkgA', date, ignore.deps='ROracle')

and whichever version is loaded will be tolerated.