| is_installed {rlang} | R Documentation |
These functions check that packages are installed with minimal side effects. If installed, the packages will be loaded but not attached.
is_installed() doesn't interact with the user. It simply
returns TRUE or FALSE depending on whether the packages are
installed.
In interactive sessions, check_installed() asks the user
whether to install missing packages. If the user accepts, the
packages are installed with pak::pkg_install() if available, or
utils::install.packages() otherwise. If the session is non
interactive or if the user chooses not to install the packages,
the current evaluation is aborted.
is_installed(pkg) check_installed(pkg, reason = NULL)
pkg |
The package names. |
reason |
Optional string indicating why is |
is_installed() returns TRUE if all package names
provided in pkg are installed, FALSE
otherwise. check_installed() either doesn't return or returns
NULL.
is_installed("utils")
is_installed(c("base", "ggplot5"))