Skip to contents

Removes a package from the search path, using the same naming convention as library.

Usage

unlibrary(package)

Arguments

package

The name of the package to unload, with or without quotes.

Value

Called for its side effect of removing the package from the search path. Returns the result of detach invisibly.

Details

Calls detach on the named package. Unlike detach, which requires the full "package:name" string, unlibrary accepts the bare package name (with or without quotes), matching the syntax of library. Only the named package is unloaded; dependencies are not affected.

See also

Examples

if (FALSE) {
  # after loading a package with library(), unload it with unlibrary()
  unlibrary(MASS)
}