Skip to content

Configuration entries for several pkgdepends classes.




pkgdepends configuration is set from several source. They are, in the order of preference:

  • Function arguments, e.g. the config argument of new_pkg_installation_proposal().

  • Global options, set via options(). The name of the global option is the pkg. prefix plus the name of the pkgdepends configuration entry. E.g. pkg.platforms.

  • Environment variables. The name of the environment variable is the PKG_ prefix, plus the name of the pkgdepends configuration entry, in uppercase. E.g. PKG_PLATFORMS.

  • Default values.

Not all classes use all entries. E.g. a pkg_download_proposal is not concerned about package libraries, so it'll ignore the library configuration entry.

Call current_config() to print the current configuration.

Configuration entries

  • library: package library to use for checking already installed packages when considering dependencies in dependency lookup or package installation. Defaults to the first path in .libPaths().

  • cache_dir: directory to download the packages to. Defaults to a temporary directory within the R session temporary directory, see base::tempdir().

  • package_cache_dir: package cache location of pkgcache::package_cache. The default is the pkgcache default.

  • metadata_cache_dir: location of metadata replica of pkgcache::cranlike_metadata_cache. Defaults to a temporary directory within the R session temporary directory, see base::tempdir().

  • platforms: Character vector of platforms to download or install for. See default_platforms() for possible platform names.

  • windows_archs: Character scalar specifying which architectures to download/install for on Windows. Its possible values are:

    • "prefer-x64": Generally prefer x64 binaries. If the current R session is x64, then we download/install x64 packages. (These packages might still be multi-architecture binaries!) If the current R session is i386, then we download/install packages for both architectures. This might mean compiling packages from source if the binary packages are for x64 only, like the CRAN Windows binaries for R 4.2.x currently. "prefer" is the default from R 4.2.0.

    • "both": Always download/install packages for both i386 and x64 architectures. This might need compilation from source if the available binaries are for x64 only, like the CRAN Windows binaries for R 4.2.x currently. "both" is the default before R 4.2.0.

  • cran_mirror: CRAN mirror to use. Defaults to the repos option (see base::options()), if that's not set then

  • dependencies: Dependencies to consider or download or install. Defaults to the hard dependencies, see pkg_dep_types_hard(). The following values are supported in the PKG_DEPENDENCIES environment variable: "TRUE", "FALSE", "NA", or a semicolon separated list of dependency types. See as_pkg_dependencies() for details.

  • r_versions: Character vector, R versions to download or install packages for. It defaults to the current R version.

  • build_vignettes: Whether to build vignettes for package trees. This is only used if the package is obtained from a package tree, and not from a source (or binary) package archive. By default vignettes are not built in this case. If you set this to TRUE, then you need to make sure that the vignette builder packages are available, as these are not installed by default currently.

  • metadata_update_after: A time interval as a difftime object. pkgdepends will update the metadata cache if it is older than this. The default is one day. The PKG_METADATA_UPDATE_AFTER environment variable may be set in seconds (s suffix), minutes (m suffix), hours (h suffix), or days (d suffix). E.g: 1d means one day.

  • sysreqs: Whether to look up and install system requirements. By default this is TRUE if the CI environment variable is set and the operating system is a supported Linux distribution: CentOS, openSUSE, RedHat Linux, Ubuntu Linux or SUSE Linux Enterprise. The default will change as new platforms gain system requirements support.

  • sysreqs_rspm_repo_id: RStudio Package Manager repository id to use for CRAN system requirements lookup. Defaults to the RSPM_REPO_ID environment variable, if set. If not set, then it defaults to 1.

  • sysreqs_rspm_url: Root URL of RStudio Package Manager for system requirements lookup. By default the RSPM_ROOT environment variable is used, if set. If not set, it defaults to

  • sysreqs_sudo: Whether to use sudo to install system requirements, on Unix. By default it is TRUE on Linux if the effective user id of the current process is not the root user.

  • sysreqs_verbose: Whether to echo the output of system requirements installation. Defaults to TRUE if the CI environment variable is set.