check_for_pkg | R Documentation |
Uses requireNamespace()
to check if a package is already installed and
provides options for issuing an error, warning, etc. in case the package is
not installed.
check_for_pkg(package, func = stop)
package |
the name of the package to check for |
func |
what should this check call if the package is not installed?
This can be any function, but |
It is only exported for use in examples.
TRUE
if the package is installed, FALSE
if it is not (invisibly)
check_for_pkg("DBI")
check_for_pkg("no-such-package", func = message)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.