well,
for sure, one option is to trace the garbage collector gc() by a function that enumerates the list of known objects and compares this with its successor. But that's not reliable, as i can't really control when to call the garbage collector. i also don't like to enumerate objects and to compare these lists at each time step.

what else could be done?

cheers,
Thomas

Thomas Liebig schrieb:
Hello R users,

i'm wondering how to trigger variable creation.
Whenever a variable is created i want my own function myFun(...) to be started.

if (exists("x")) {rm(x)} # after removal of x
                         # any of these calls
x<-10                    # should call myFun
x=10                     # should call myFun
assign(x,10)             # should call myFun
etc.
                         # afterwards, each of the calls
x<-15                    # should not call myFun
x=15                     # should not call myFun
assign(x,15)             # should not call myFun
etc.

Has anyone an idea? Unfortunately, this feature is also missing in the library trackObjs.

regards,
Thomas


--
Thomas Liebig
Fraunhofer-Institut für Intelligente Analyse- und
Informationssysteme (IAIS)

Schloss Birlinghoven, D-53754 Sankt Augustin, Germany
Email:  thomas.lie...@iais.fraunhofer.de
Phone:  +49 2241 142050
Fax:    +49 2241 142072

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to