Skip to content

Download a package and potentially its dependencies as well

Usage

pkg_download(
  pkg,
  dest_dir = ".",
  dependencies = FALSE,
  platforms = NULL,
  r_versions = NULL
)

Arguments

pkg

Package names or remote package specifications to download.

dest_dir

Destination directory for the packages. If it does not exist, then it will be created.

dependencies

Dependency types, to download the (recursive) dependencies of pkg as well. See pkgdepends::as_pkg_dependencies() for possible values.

platforms

Types of binary or source packages to download. The default is the value of pkgdepends::default_platforms().

r_versions

R version(s) to download packages for. (This does not matter for source packages, but it does for binaries.) It defaults to the current R version.

Value

Data frame with information about the downloaded packages, invisibly.

See also

Examples

if (FALSE) {
pkg_download("forcats")
pkg_download("r-lib/pak", platforms = "source")
}