clear: Clear memory of all objects

Description Usage Arguments Author(s) Examples

View source: R/clear.R

Description

This function is a wrapper for the command rm(list=ls()). It's just less keystrokes.

Usage

1
clear(obj = NULL, keep = TRUE)

Arguments

obj

The object (as a string) that needs to be removed (or kept)

keep

Should obj be kept (i.e., everything but obj removed)? Or dropped?

Author(s)

Dustin Fife

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#NOTE: ONLY RUN THIS IF YOU DON'T MIND ERASING YOUR R SESSION
a = 5
ls()	### a shows up
clear()
ls()	### nothing shows up
### create objects
a=1; b=2; c=3; d=4; e=5
### remove c
clear("c", keep=FALSE)
ls()
### remove all but a and b
clear(c("a", "b"), keep=TRUE)
ls()

fifer documentation built on May 30, 2017, 7:40 a.m.

Related to clear in fifer...