[S] Q: Removing objects in functions

Oliver Klinger (klinger@lkn.e-technik.tu-muenchen.de)
Tue, 14 Jul 1998 16:26:54 +0200

Hello, dear S+ users!

It seems to me that inside a function1 the assignment

function1 <- function(x) {
x <- my.function(x) # this is the critical assignment

DOES NOT replace the old 'x' with the the new 'x', but a copy of the old
'x' exists until function1 terminates. In order to save memory I HAVE
TO delete those old copies, otherwise I run out of memory. But the
command remove("x") does not work on objects that are only defined
inside a function and are not in the working directory.

Is there a way to delete an object that is only defined in a function
and not globally?

Thanx a lot

This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news