Re: [R] Quickie : unload library

From: Sarah Goslee <sarah.goslee_at_gmail.com>
Date: Sat 26 Aug 2006 - 06:23:59 EST

Hi,

There are two ways that I know of:
detach("package:zoo")
or use detach() with the number of that package's place in the search list.

> library(zoo)
> search()

 [1] ".GlobalEnv"        "package:zoo"       "package:methods"
 [4] "package:graphics"  "package:grDevices" "package:utils"
 [7] "package:datasets"  "package:ecoutils"  "package:ecodist"
[10] "package:stats"     "package:gtkDevice" "Autoloads"
[13] "package:base"
> detach("package:zoo")
> search()
 [1] ".GlobalEnv"        "package:methods"   "package:graphics"
 [4] "package:grDevices" "package:utils"     "package:datasets"
 [7] "package:ecoutils"  "package:ecodist"   "package:stats"
[10] "package:gtkDevice" "Autoloads"         "package:base"

OR

> library(zoo)
> search()

 [1] ".GlobalEnv"        "package:zoo"       "package:methods"
 [4] "package:graphics"  "package:grDevices" "package:utils"
 [7] "package:datasets"  "package:ecoutils"  "package:ecodist"
[10] "package:stats"     "package:gtkDevice" "Autoloads"
[13] "package:base"
> detach(2)
> search()
 [1] ".GlobalEnv"        "package:methods"   "package:graphics"
 [4] "package:grDevices" "package:utils"     "package:datasets"
 [7] "package:ecoutils"  "package:ecodist"   "package:stats"
[10] "package:gtkDevice" "Autoloads"         "package:base"

Sarah

-- 
Sarah Goslee
http://www.stringpage.com

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Aug 26 06:48:55 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 26 Aug 2006 - 14:23:08 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.