require()
, but it does not load the
package in the current R session. Instead, it launches a new R session to
test if a package is loadable. The reason for that is it is not trivial to
remove all the side effects brought by library()
, such as
DLL's. Instead of cleaning up everything, we just use a new R session to test
if a package is loadable.
pkg_loadable(p)
TRUE
or FALSE
.