detach {base} | R Documentation |
Detach a database, i.e., remove it from the search()
path
of available R objects. Usually, this either a data.frame
which has been attach
ed or a package which was required
previously.
detach(name, pos = 2)
name |
The object to detach. Defaults to |
pos |
Index position in |
The attached database is returned invisibly, either as
data.frame
or as list
.
You cannot detach either the workspace (position 1) or the base
package (the last item in the search list).
attach
, library
, search
,
objects
.
require(eda)#package
detach(package:eda)
## could equally well use detach("package:eda")
## but NOT pkg <- "package:eda"; detach(pkg)
## Instead, use
library(eda)
pkg <- "package:eda"
detach(pos = match(pkg, search()))
library(mva)
detach(2)# `pos' used for `name'