Just a quick tidbit about unloading a library from the current R session using detach().
Say we have a current session of R open, and, lo and behold, there is a new version of "phytools" available. If we download the binaries and try to install, e.g.:
> install.packages("phytools_0.0-3.zip",repos=NULL)
we get the following error:
Warning: package 'phytools' is in use and will not be installed
This can be avoided simply by unloading the library before installing, and the reloading the new version afterwards. This is accomplished as follows:
> detach(package:phytools)
> install.packages("phytools_0.0-3.zip",repos=NULL)
package 'phytools' successfully unpacked and MD5 sums checked
> require(phytools)
Loading required package: phytools
Of course, this also applies to packages installed from a CRAN mirror.
This a very old post, but I think this will not really unload the package unless you do:
ReplyDeletedetach("package:phytools",unload=TRUE)