Remove All Objects, Except Those Specified
Remove all objects from the user workspace, except those specified.
keep(..., list=character(0), all=FALSE, sure=FALSE)
objects to be kept, specified one by one, quoted or unquoted.
character vector of object names to be kept.
whether hidden objects (beginning with a
.) should be removed, unless explicitly kept.
whether to perform the removal, otherwise return names of objects that would have been removed.
Implemented with safety caps: objects whose name starts with a
. are not removed unless
all=TRUE, and an explicit
sure=TRUE is required to remove anything.
A character vector containing object names, or
keep is a convenient interface to
removing most objects from the user workspace.
data(women, cars) keep(cars) ## To remove all objects except cars, run: ## keep(cars, sure=TRUE)