This can be used later by installVersions to install or re-install the correct versions.

pkgSnapshot(packageVersionFile, libPath, standAlone = FALSE)

Arguments

packageVersionFile

A filename to save the packages and their currently installed version numbers. Defaults to ".packageVersions.txt".

libPath

The path to the local library where packages are installed. Defaults to the .libPaths()[1]

standAlone

Logical. If TRUE, all packages will be installed and loaded strictly from the libPaths only. If FALSE, all .libPaths will be used to find the correct versions. This can be create dramatically faster installs if the user has a substantial number of the packages already in their personal library. In the case of TRUE, there will be a hidden file place in the libPath directory that lists all the packages that were needed during the Require call. Default FALSE to minimize package installing.

Details

A file is written with the package names and versions of all packages within libPath. This can later be passed to Require.

Examples

pkgSnapFile <- tempfile() pkgSnapshot(pkgSnapFile, .libPaths()[1])
#> instPkgs instVers #> 1: archivist 2.3.1 #> 2: assertthat 0.2.0 #> 3: backports 1.1.2 #> 4: BH 1.66.0-1 #> 5: bindr 0.1.1 #> --- #> 127: parallel 3.5.1 #> 128: stats 3.5.1 #> 129: tcltk 3.5.1 #> 130: tools 3.5.1 #> 131: utils 3.5.1
data.table::fread(pkgSnapFile)
#> instPkgs instVers #> 1: archivist 2.3.1 #> 2: assertthat 0.2.0 #> 3: backports 1.1.2 #> 4: BH 1.66.0-1 #> 5: bindr 0.1.1 #> --- #> 127: parallel 3.5.1 #> 128: stats 3.5.1 #> 129: tcltk 3.5.1 #> 130: tools 3.5.1 #> 131: utils 3.5.1