I’m trying to install R package A into a Singularity container with R 3.6.0. Package A needs R package B as a dependency. I originally installed package A with version 1 of package B, and things worked fine. Now, however, I need to rebuild this setup, and it appears that version 2 of package B has come out. For some reason, package B version 2 doesn’t build on my machine, and gives random compiler errors that I can’t find any reference to online. I can still install version 1 of package B no problem. However, when I try to install package A, it pulls version 2 of package B from CRAN, even though the correct version (version 1) of package B is already installed, thus making the whole thing not work as version 2 of package B fails to build.
How can I tell R to not grab the latest version of package B, and to just use the one already installed? This is on CentOS 7 building inside of a Singularity container. I’m using the standard "install.packages" function to install package A, and the "install_version" command from devtools to install the specific version of package B. I want to stress that package A is still being installed as the same version, and that the entire issue here stems from R pulling the version 2 of package B, even though the same version of package A originally worked fine with version 1 of package B.
2
Answers
I would:
install_version
install.packages("A", dependencies=FALSE)
The easiest way is to use packages in versions that worked for you before. For that find out the date when it worked at put into repo url.
Before running that command ensure that B is removed.