Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Testing Package Availability

If the function depends on the functionality of some package, such as gplots, for example, use the stopifnot function to exit if the package is not available:

myfun <- function()
{
  stopifnot(require(gplots))
  [...]
}

inside functions that require specific package functionality.



Copyright © 2004-2005
Brought to you by Togaware.