s-news
[Top] [All Lists]

Re: cleaning out .Data directory before I start

To: "Leeds, Mark" <mleeds@mlp.com>
Subject: Re: cleaning out .Data directory before I start
From: Spencer Graves <spencer.graves@pdf.com>
Date: Mon, 27 Oct 2003 02:29:05 -0800
Cc: s-news@wubios.wustl.edu
In-reply-to: <37DA35FDF352A24AB931404B856180FA02FB2A@MAIL002.AD.MLP.COM>
References: <37DA35FDF352A24AB931404B856180FA02FB2A@MAIL002.AD.MLP.COM>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
I don't understand "match", but you can get a glimpse of the problem by listing

     M
     is.na(M)
     !is.na(M)
     -!is.na(M)

However, the following should do what you want:
     L <- L[!is.element(L, "europesignal")]
     remove(L)

I would list L before I executed "remove", however, at least the first time.
     hope this helps.  spencer graves

Leeds, Mark wrote:

i am trying to have some code at the beginning of my Splus so that everything in the working directory ( .Data directory ) is deleted before the program starts, except for one object called
"europesignal".
so, i wrote the following code which i thought would work ? L<-ls() M<-match(c("__Help","__Hhelp","__Meta","__Shelp", ".Last.value","europesignal"),L)
L<-L[-!is.na(M)]
remove(list=L)
for whatever reason, this doesn't work in that europesignal still gets deleted from the current directory. does any know either why either the above deosn't work or any way of deleting all the objects in a working data directory
except for one of which the name is known, "europesignal". thanks.
I don't know if i have to worry about accidentally deleting those __Help, __Meta directories because
I don't think they should be deleted.
thanks.



<Prev in Thread] Current Thread [Next in Thread>