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