Detach Data from Search List

DESCRIPTION:
Removes a database from the search list. The database may be specified by a number, by name, or with a logical vector.

USAGE:
detach(what=2, save=T)

OPTIONAL ARGUMENTS:
what:
character string, logical vector, or integer position. If what is character, then it is the name of the database to be taken out of the search list. If what is a logical vector, it should be the same length as the current search list (it will be replicated if it is not); the TRUE value should correspond to the database to be detached. If what is numeric, it gives the position of the database in the search list to be detached.
save:
logical flag or character string. This can be FALSE to suppress saving, or a character string to specify the name of the object to be created, in the working database, to hold the modified database being detached. Saving only makes sense if the attached database was itself an object. If what=1, saving takes place in the new working data; i.e., in the database currently second on the search list.

VALUE:
character vector giving names of directories and objects being searched prior to the call to detach.

SIDE EFFECTS:
deletes one or more of the objects or directories that are searched.

WARNING:
Do not detach the .../s/.Functions directory. This will remove the basic S-PLUS functions including attach and q, essentially immobilizing the language. The only remedy is to exit S-PLUS with a "control-D" or a "control-backslash"

BUGS:
The save=TRUE option does not work. You need to give save as a character string in order to have a changed object saved.

If you are saving an object, you need to specify what as a number; specifying it as a character string will cause an error.


SEE ALSO:
attach , assign , dbread (for dbdetach ).

EXAMPLES:
detach("abc")
detach(what=4) #detach the fourth object from the search list