keep | R Documentation |
Remove all objects from the user workspace, except those specified.
keep(..., list=character(), all=FALSE, sure=FALSE)
... |
objects to be kept, specified one by one, quoted or unquoted. |
list |
character vector of object names to be kept. |
all |
whether hidden objects (beginning with a |
sure |
whether to perform the removal, otherwise return names of objects that would be 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 that are deleted if
sure=TRUE
.
Arni Magnusson
keep
is a convenient interface to rm
for removing
most objects from the user workspace.
data(trees, CO2)
keep(trees)
# To remove all objects except trees, run:
# keep(trees, sure=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.