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.liebig at iais.fraunhofer.de
Phone: +49 2241 142050
Fax: +49 2241 142072
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.liebig at iais.fraunhofer.de Phone: +49 2241 142050 Fax: +49 2241 142072
Possibly Parallel Threads
- write text file as output without quotes
- ifelse on a series of rows for multiple criteria
- mvbutils and trackObjs
- new package 'trackObjs' - mirror objects to files, provide summaries & modification times
- new package 'trackObjs' - mirror objects to files, provide summaries & modification times