transfer_packages: Easily reinstall all currently installed packages on another...

View source: R/transfer_packages.R

transfer_packagesR Documentation

Easily reinstall all currently installed packages on another machine or version of R.

Description

Easily reinstall all currently installed packages on another machine or version of R.

Usage

transfer_packages(
  library = .libPaths()[1],
  output = "online",
  expiry = "7d",
  filename = "transfer_packages",
  list_remotes = TRUE,
  quiet = FALSE
)

Arguments

library

The location of the library on the current machine to copy.

output

One of online (the default), gist or local. Saves a list of installed packages to the chosen location, and provides instructions on how to use this to (re)install the packages elsewhere. See details for more information.

expiry

Expiry for online file store in days. Weeks can be given with w, or months with m. Default is 7 days. Will be ignored if output is not online.

filename

Filename for the local output file. Ignored if output is not set to local.

list_remotes

Logical (default TRUE). Check for any packages installed from repositories other than CRAN, and output instructions to reinstall.

quiet

Logical (default FALSE). Suppress output if TRUE.

Details

If output is online, the resulting list of currently installed packages is stored on https://file.io for the time specified in expiry, or until the URL is first accessed. Note that both visiting the URL and sourcing the URL count as access, and it will be removed after either. If output is local, an R script file (.R) is saved to the current working directory, which can be transferred manually to another machine. Beware if using quiet = TRUE together with output = online, as the source command will not be

Value

Prints instructions to console if quiet = FALSE, and invisibly returns the source command to use on the other machine.


biometryhub/BiometryTools documentation built on July 14, 2024, 4:42 p.m.