% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ship.R
\name{ship}
\alias{ship}
\title{Ship packages between R installations}
\usage{
ship(
  source_path,
  target_path,
  packages = NULL,
  dry_run = FALSE,
  upgrade = FALSE,
  ...
)
}
\arguments{
\item{source_path}{Rscript path of the source installation}

\item{target_path}{Rscript path of the target installation}

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

\item{dry_run}{Logical. If TRUE, return plan without installing.}

\item{upgrade}{Logical. Passed to pak}

\item{...}{Extra arguments}
}
\value{
A list with shipment results
}
\description{
Ship packages between R installations
}
\section{Safety}{

\code{ship()} installs packages into the target R library via \code{\link[pak:pkg_install]{pak::pkg_install()}}
running in a subprocess. Set \code{dry_run = TRUE} to preview the migration plan
without installing anything. When \code{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{
\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)
  }
}
}
