Records, for every package named, its version and enough about its provenance to find the same one again: the library it was loaded from, the repository it was installed from, and – for a package installed from a remote – the remote's URL and commit.
Usage
capture_dependencies(packages = loadedNamespaces())Value
A data frame with one row per package: package,
version, library, repository, remote_url,
remote_sha, built. Unavailable fields are NA rather
than omitted, so a reader can see that the information was absent rather
than forgotten.
Details
Why versions alone are not enough. Two installations can report the same
version and differ: one built from CRAN, one from a fork, one from a
local R CMD INSTALL of a working tree with uncommitted changes. A
version number identifies an intention; the repository and commit
identify what was actually loaded.