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)
Logical TRUE if the package was successfully unloaded, FALSE otherwise.
if (FALSE) { # \dontrun{
force_unload_package("ggplot2")
} # }