Package Dependency Resolution, Downloads and Installation
pkgdepends is a toolkit for package dependencies, downloads and installations, to be used in other packages. If you are looking for a package manager, see pak.
- Look up package dependencies recursively.
- Visualize package dependencies.
- Download packages and their dependencies.
- Install downloaded packages.
- Includes a dependency solver to find a consistent set of dependencies.
- Supports CRAN and Bioconductor packages automatically.
- Supports packages on GitHub.
- Supports local package file and trees.
- Supports the
Remotesentry in theDESCRIPTIONfile. - Caches metadata and downloaded packages via pkgcache
- Performs all downloads and HTTP queries concurrently.
- Builds and installs packages in parallel.
install.packages("pkgdepends")library(pkgdepends)A package reference (ref) specifies a location from which an R package can be obtained from. Examples:
devtools
cran::devtools
bioc::Biobase
r-lib/pkgdepends
https://github.com/r-lib/pkgdepends
local::~/works/shiny
See “Package references” for details.
Dependencies of the development version of the cli package:
pd <- new_pkg_deps("r-lib/cli")
pd$solve()
pd$draw()#> cli (1.9.9.9000)
#> ├─assertthat (0.2.1)
#> ├─crayon (1.3.4)
#> ├─glue (1.3.1)
#> ├─progress (1.2.2)
#> │ ├─hms (0.5.1)
#> │ │ ├─pkgconfig (2.0.3)
#> │ │ ├─rlang (0.4.0)
#> │ │ └─vctrs (0.2.0)
#> │ │ ├─backports (1.1.5)
#> │ │ ├─ellipsis (0.3.0)
#> │ │ │ └─rlang (0.4.0)
#> │ │ ├─digest (0.6.21)
#> │ │ ├─glue (1.3.1)
#> │ │ ├─rlang (0.4.0)
#> │ │ └─zeallot (0.1.0)
#> │ ├─prettyunits (1.0.2)
#> │ │ ├─magrittr (1.5)
#> │ │ └─assertthat (0.2.1)
#> │ ├─R6 (2.4.0)
#> │ └─crayon (1.3.4)
#> └─fansi (0.4.0)
See the pkg_deps class for details.
Downloading all dependencies of a package:
pdl <- new_pkg_download_proposal("r-lib/cli")
pdl$resolve()
pdl$download()See the pkg_download_proposal class for details.
Installing or updating a set of package:
lib <- tempfile()
pdi <- new_pkg_installation_proposal(
"r-lib/cli",
config = list(library = lib)
)
pdi$solve()
pdi$download()
pdi$install()#> Your system is ready to build packages!
#> Your system is ready to build packages!
#> Installed: 17
#> Build time: 2.8s
#> Intall time: 1.6s
pkg_deps, pkg_download_proposal and
pkg_installation_proposal all resolve their dependencies
recursively, to obtain information about all packages needed for the
specified package references. See “Dependency
resolution” for details.
The dependency solver takes the resolution information, and works out the exact versions of each package that must be installed, such that version and other requirements are satisfied. See “The dependency solver” for details.
pkg_installation_proposal can create installation plans, and
then also install them. It is also possible to import installation plans
that were created by other tools. See “Installation plans” for
details.
The details of pkg_deps, pkg_download_proposal and
pkg_installation_proposal can be tuned with a list of
configuration options. See “Configuration” for details.
- pak – R package manager
- pkgcache – Metadata and package cache
- devtools – Tools for R package developers
MIT © RStudio