Returns a character vector of commands to run that will install system requirements for the queried operating system.

local_system_requirements() queries system requirements for a dev package (and its dependencies) given its root path.

pkg_system_requirements() queries system requirements for existing packages (and their dependencies).

local_system_requirements(
  os = NULL,
  os_release = NULL,
  root = ".",
  execute = FALSE,
  sudo = execute,
  echo = FALSE
)

pkg_system_requirements(
  package,
  os = NULL,
  os_release = NULL,
  execute = FALSE,
  sudo = execute,
  echo = FALSE
)

Arguments

os, os_release

The operating system and operating system release version, e.g. "ubuntu", "debian", "centos", "redhat". See https://github.com/rstudio/r-system-requirements#operating-systems for all full list of supported operating systems.

If NULL, the default, these will be looked up using distro::distro().

root

Path to the package tree.

execute, sudo

If execute is TRUE, pak will execute the system commands (if any). If sudo is TRUE, pak will prepend the commands with sudo.

echo

If echo is TRUE and execute is TRUE, echo the command output.

package

Package names to lookup system requirements for.

Value

A character vector of commands needed to install the system requirements for the package.

Examples

if (FALSE) {
local_system_requirements("ubuntu", "20.04")
}
if (FALSE) {
pkg_system_requirements("pak", "ubuntu", "20.04")
pkg_system_requirements("pak", "redhat", "7")
pkg_system_requirements("config", "ubuntu", "20.04") # no sys reqs
pkg_system_requirements("curl", "ubuntu", "20.04")
pkg_system_requirements("git2r", "ubuntu", "20.04")
pkg_system_requirements(c("config", "git2r", "curl"), "ubuntu", "20.04")
# queried packages must exist
pkg_system_requirements("iDontExist", "ubuntu", "20.04")
pkg_system_requirements(c("curl", "iDontExist"), "ubuntu", "20.04")
}