[R] what's the command in R to completely clear the state of the console(including clearing up libraries, etc?)

Hadley Wickham hadley at rice.edu
Sun Jan 1 19:55:24 CET 2012

>> My understanding is that one only clears the variables... not
>> functions/packages, etc...
> Not exactly true. rm should remove any function you defined in your current
> session. You need to look at
> ?unloadNamespace
> ?detach
> ...  in order to remove loaded packages.

And read the caveats there.  It's basically not possible to reset your
R session to a completely clean slate.  You're best off just starting
a new one.


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

More information about the R-help mailing list