[R] How to remove all objects except a few specified objects?

500600 romunov at gmail.com
Tue Aug 24 09:04:29 CEST 2010


a <- 1
b <- 2
c <- 3

ls()[-a]  # set minus to all the objects you want to retain

rm(list = ls()[-a]  # will remove all the objects - except a

ls()  # presto
-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2336200.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list