is_installed {rlang}R Documentation

Are packages installed in any of the libraries?

Description

These functions check that packages are installed with minimal side effects. If installed, the packages will be loaded but not attached.

Usage

is_installed(pkg)

check_installed(pkg, reason = NULL)

Arguments

pkg

The package names.

reason

Optional string indicating why is pkg needed. Appears in error messages (if non-interactive) and user prompts (if interactive).

Value

is_installed() returns TRUE if all package names provided in pkg are installed, FALSE otherwise. check_installed() either doesn't return or returns NULL.

Examples

is_installed("utils")
is_installed(c("base", "ggplot5"))

[Package rlang version 0.4.11 Index]