Find Build-Time Package Dependencies
Most R package dependencies are run-time dependencies: functions within a package refer to functions or other objects within another package. These references are resolved at runtime, and for evaluating the code of a package (i.e. installing it), the dependencies are not actually needed. This package tries to work out the build-time and run-time dependencies of a package, by trying to evaluate the package code both without and with each dependency.
source("https://install-github.me/r-hub/builddeps")
library(builddeps)
build_deps(<package-tree>)
Most R package dependencies are run-time dependencies: functions within a package refer to functions or other objects within another package. These references are resolved at runtime, and for evaluating the code of a package (i.e. installing it), the dependencies are not actually needed. This package tries to work out the build-time and run-time dependencies of a package, by trying to evaluate the package code both without and with each dependency.
The current algorithms is this:
LinkingTo
), this is
a build-time dependency, and we install it.LinkingTo
dependencies available. This should already run without errors for
most packages, and if it indeed does, then there are no additional
build dependencies.It is important that in step 4., the packages are considered in an
appropriate order. E.g. if pkg -> A -> B
and also pkg -> B
holds,
then we cannot try to omit package B
first, because even if it is not
a build dependency, it is needed for package A
, so the installation
of pkg
will fail. So we create the dependency graph of all recursive
dependencies of the package, and try omitting the (directly dependent)
packages according to the topological ordering.
E.g. for the example above, we test package A
first. (Assuming there
are no other direct dependencies depending on A
, directly or
indirectly.)
A
is a build dependency, then we always keep it installed in the
following package tests.A
is not a build dependency, then we can remove it from the
testing procedure for good, as no other packages in the dependency
tree depend on it directly or indirectly.MIT © R Consortium
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.