Automate Recursively Determining and Installing Missing
dependencies.
Barry
Zeeberg
I was using my previous packages noviceDeveloperResources and noviceDeveloperResources2 to automatically load a list of packages, when I encountered an obscure error message. I eventually tracked down the error, which arose from several recursive dependencies not being installed in my library.
I developed the current package InstallationDriver to avoid this problem for myself and other users in the future. It recursively finds any missing CRAN package dependencies (“Depends”, “Imports”, “LinkingTo”) and installs them from the CRAN repository. The main mechanisms used are tools::package_dependencies() and utils::install.packages().
Here is an example transcript obtained after I had purposely removed the dependency hash
Technical Note: Return Value of
install.packages()
Not well documented anywhere, but I fortuitously noticed that
verbose=TRUE generates a message with the word “succeeded” when
installing from a local source .tar.gz https://stackoverflow.com/questions/64797849/how-to-save-verbose-output
. I had previously used this approach in
NoviceDeveloperResources::checkBuildInstallSourcePackage().
In contrast, upon failure, we can detect “NA” rather than “succeeded”
When applying this
to a download from remote CRAN repository, the return codes are
different
Upon
failure