Learn R Programming

lsr (version 1.0.0)

unlibrary: Unload a package

Description

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

Usage

unlibrary(package)

Value

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

Arguments

package

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

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

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

Run the code above in your browser using DataLab