Assert a package is installed.

assert_is_installed(pkg)

Arguments

pkg

Character vector giving the name of a package.

Value

An error if pkg is not installed or invisible pkg if it is.

Examples

assert_is_installed("base")
if (FALSE) {
try(assert_is_installed("bad"))
}