This function forcefully unloads a package from R by detaching it from the search path, unloading its namespace, and trying to remove it from all environments.

force_unload_package(pkg)

Arguments

pkg

The name of the package to unload as a string.

Value

Logical TRUE if the package was successfully unloaded, FALSE otherwise.

Examples

if (FALSE) { # \dontrun{
  force_unload_package("ggplot2")
} # }