Skip to content
Prev 22120 / 398498 Next

remove objects(1-20, 25-30) OR remove objects(...) except(...)??

You can remove everything but specified objects using setdiff()

 > a <- 1
 > b <- 2
 > c <- 3
 > objects()
[1] "a" "b" "c"
 > rm(list=setdiff(objects(), "a"))
 > objects()
[1] "a"
 >

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._