Collect information about dependencies of R packages, recursively.

Details

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.

CRAN and Bioconductor packages

Resolution currently start by downloading the CRAN and Bioconductor metadata, if it is out of date. For CRAN, we also download additional metadata, that includes file sizes, SHA hashes, system requirements, and "built" (for binary packages) and "packaged" time stamps. The extra meta information is updated daily currently, so for some packages it might be incorrect or missing.

GitHub packages

For GitHub packages, we query their download URL to be able to download the package later, and also download their DESCRIPTION file, to learn about their dependencies.

Local packages

From local package files we extract the DESCRIPTION file, to learn about their dependencies.

The remotes field in DESCRIPTION

We support the non-standard Remotes field in the package DESCRIPTION file. This field may contain a list of package references for any of the dependencies that are specified in one of the Depends, Includes, Suggests or Enhances fields. The syntax is a comma separated list of package references.

The result

The result of the resolution is a data frame (tibble) with lots of information about the packages and their dependencies. The columns that are not documented here may be removed or changed, because they are either used internally or experimental.

  • built: The Built field from the DESCRIPTION file of binary packages, for which this information is available.

  • cache_status: Whether the package file is in the package cache. It is NA for installed:: package refs.

  • dep_types: Character vector of dependency types that were considered for this package. (This is a list column.)

  • deps: Dependencies of the package, in a data frame (tibble). See 'Package dependency tables' below.

  • direct: Whether this package (ref, really) was directly specified, or added as a dependency.

  • error: This is a list column that contains error objects for the refs that pkgdepends failed to resolve.

  • filesize: The file size in bytes, or NA if this information is not available.

  • license: License of the package, or NA if not available.

  • md5sum: MD5 checksum of the package file, if available, or NA if not.

  • metadata: A named character vector. These fields will be (should be) added to the installed DESCRIPTION file of the package.

  • mirror: URL of the CRAN(-like) mirror site where the metadata was obtained from. It is NA for non-CRAN-like sources, e.g. local files, installed packages, GitHub, etc.

  • needscompilation: Whether the package needs compilation.

  • package: Package name.

  • priority: This is "base" for base packages, "recommended" for recommended packages, and NA otherwise.

  • ref: Package reference.

  • remote: The parsed remote_ref objects, see parse_pkg_refs(). This is a list column.

  • repodir: The directory where this package should be in a CRAN-like repository.

  • sha256: SHA256 hash of the package file, if available, otherwise NA.

  • sources: URLs where this package can be downloaded from. This is a zero length vector for installed:: refs.

  • status: Status of the dependency resolution, "OK" or "FAILED".

  • target: Path where this package should saved in a CRAN-repository.

  • type: Ref type.

  • version: Package version.

Package dependency tables

A package dependency table has five columns currently:

  • ref: The package ref of the dependency.

  • type: The dependency type, in all lowercase. I.e. imports, suggests, etc.

  • op: Operator for version requirements, e.g. >=.

  • version: Version number, for version requirements.

Resolution failures

The resolution process does not stop on error. Instead, failed resolutions return and error object in the error column of the result data frame.