Want to unload a package without restarting R? It is possible to have multiple versions of a package loaded at once (for example, if you have a development version and a stable version in different libraries). To guarantee that all copies are detached, use this function.
detach_package <- function(pkg, character.only = FALSE)
pkg <- deparse(substitute(pkg))
search_item <- paste("package", pkg, sep = ":")
while(search_item %in% search())
detach(search_item, unload = TRUE, character.only = TRUE)
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.