File: keep.Rd

package info (click to toggle)
gregmisc 2.0.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,712 kB
  • ctags: 379
  • sloc: perl: 5,142; asm: 127; sh: 30; makefile: 17
file content (44 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\name{keep}
\alias{keep}
\title{
  Remove All Objects, Except Those Specified
}
\description{
  Remove all objects from the default workspace, except those specified.
}
\usage{
keep(..., list = character(0), sure = FALSE)
}
\arguments{
  \item{...}{objects to be kept, specified one by one, quoted or
    unquoted.}
  \item{list}{character vector of object names to be kept.}
  \item{sure}{whether to perform the removal, otherwise return names of
    objects that would have been removed.}
}
\details{
  Convenient interface to \code{rm()} when removing most objects from
  the default workspace.

  Implemented with a few safety caps: objects whose name starts with a
  period \sQuote{\code{.}} are not removed, and \code{sure=TRUE} is
  required to perform the removal.
}
\value{
  A character vector containing object names, or \code{NULL} when
  \code{sure} is \code{TRUE}.
}
\author{Arni Magnusson \email{arnima@u.washington.edu}}
\seealso{
  \code{\link{rm}}.
}
\examples{
data(women, cars)
keep(cars)
## To remove all objects except cars, run:
## keep(cars, sure=TRUE)
}
% Programming
\keyword{data}
\keyword{environment}
\keyword{utilities}