check_for_pkg: Check if a package is installed

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

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.

Usage

1
check_for_pkg(package, func = stop)

Arguments

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 stop, warning, skip, etc. are likely candidates (default: stop)

Details

It is only exported for use in examples.

Value

TRUE if the package is installed, FALSE if it is not (invisibly)

Examples

1
2
check_for_pkg("DBI")
check_for_pkg("no-such-package", func = message)

blaquez/dittodb documentation built on Oct. 5, 2020, 12:02 a.m.