Hi, it's not clear what you asking for, but if you want to remove all object except functions here's the shortest one-line solution that I can think of
rm(list=ls()[!sapply(ls(), FUN=exists, mode="function")]) Henrik Bengtsson Lund University, Sweden > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Yong Wang > Sent: den 25 januari 2004 04:47 > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: [R] how to keep functions while remove all other commands > > > Dear all: > a quick question: > I am used to apply rm(list=()) regularly to remove all old codes in > preventing them creeping in current analysis.however, with that > application, functions I wrote are also removed. please let > me know how to keep the thing you want while remove those you don't. > > thank you > > best > yong > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailma> n/listinfo/r-help > PLEASE > do read the posting guide! > http://www.R-project.org/posting-guide.html > > ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
