The user-friendly errors and prompting to install are great features in check_installed(). However, as seen in #1608, the check to see if a package is in fact installed is almost 3 orders of magnitude slower than the simple requireNamespace().
Would there be scope for a check_installed0() that would retain the errors and prompting of check_installed(), but use a less featureful method of detecting whether a package is installed or not, allowing better performance? That would be useful for a package providing an optional feature in a fast but frequently called function that needs to check whether an optional dependency is available.
The user-friendly errors and prompting to install are great features in
check_installed(). However, as seen in #1608, the check to see if a package is in fact installed is almost 3 orders of magnitude slower than the simplerequireNamespace().Would there be scope for a
check_installed0()that would retain the errors and prompting ofcheck_installed(), but use a less featureful method of detecting whether a package is installed or not, allowing better performance? That would be useful for a package providing an optional feature in a fast but frequently called function that needs to check whether an optional dependency is available.