Learn R Programming

courieR (version 0.2.2)

ship: Ship packages between R installations

Description

Ship packages between R installations

Usage

ship(
  source_path,
  target_path,
  packages = NULL,
  dry_run = FALSE,
  upgrade = FALSE,
  ...
)

Value

A list with shipment results

Arguments

source_path

Rscript path of the source installation

target_path

Rscript path of the target installation

packages

Optional character vector of packages to ship. If NULL, ships all non-base missing/outdated packages.

dry_run

Logical. If TRUE, return plan without installing.

upgrade

Logical. Passed to pak

...

Extra arguments

Safety

ship() installs packages into the target R library via pak::pkg_install() running in a subprocess. Set dry_run = TRUE to preview the migration plan without installing anything. When dry_run = FALSE (the default), pak from the current R session is used to install into the target library, which is the correct design for a migration tool (the source R need not have pak installed). All subprocess calls are confined to the target library path; no files are written outside the target library or the R temporary directory.

Examples

Run this code
# \donttest{
  routes <- find_routes()
  if (nrow(routes) >= 2) {
    result <- ship(
      source_path = routes$rscript_path[1],
      target_path = routes$rscript_path[2],
      dry_run = TRUE
    )
    print(result$plan)
  }
# }

Run the code above in your browser using DataLab