detach_package: Detach a Loaded Package

View source: R/package_ops.R

detach_packageR Documentation

Detach a Loaded Package

Description

Detaches a loaded R package cleanly from the current session. This is useful when reinstalling or updating a package during development.

Usage

detach_package(pkg)

Arguments

pkg

Character string of package name. The name of the package to detach.

Details

If the specified package is attached multiple times (e.g., via multiple 'library()' calls), it will be fully detached. A message is displayed indicating whether the detachment occurred.

Value

Invisibly returns TRUE if the package was detached, or FALSE if it was not attached.

See Also

library, detach

Examples

## Not run: 
detach_package("ggplot2")

## End(Not run)


ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.