[R] How do delete all R objects out off a function?

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Mar 5 14:11:14 CET 2002

Sven Garbade wrote:
> Hi,
> how can I remove all R objects in the workspace out of a function?
> rm(list=ls()) doesn't work, and I've tried several pos arguments, but
> nothing worked.


  anything <- 1
  delete.all <- function()
      rm(list=ls(pos=.GlobalEnv), pos=.GlobalEnv)

Uwe Ligges
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list