[R] Dating Objects

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Fri Aug 12 18:37:33 CEST 2005


Rolf Turner wrote:

> 	I don't follow what you aren't following ....  It seems to me
> 	to be an eminently reasonable thing to want to do.  Answers
> 	questions such as ``Was x modified since y was modified?''

  I wanted to have some sort of 'make'-like functionality in R. Suppose 
you have some complicated analysis that depends on several variables. If 
you change one of them, you might not want to redo all the parts of the 
analyses that dont depend on that change. Integrating this with Sweave 
would be another gem, since parts of your Sweave document that might 
take a long time to run might not need to run again if you've only 
changed something after that point. If it takes an hour to generate a 
dataset and two seconds to plot it, and you've made a change to the 
plot, you dont want to re-run the whole data generation again when you 
weave your document.

> 	I think I would make the modification data an ***attribute***
> 	of the object, rather than sticking it in as a component.
> 	(The latter might mess up some vital aspect of the nature
> 	of the object.)
> 
> 	The problem is to remember to date stamp each object each
> 	time it is modified ....

  A while ago I attacked this problem at the C-code level. I found out 
where R made assignments and tacked on a 'modified' attribute to the 
object at that point. However it was a quick hack and it broke R quite 
badly. One of the problems was that R objects were no longer identical 
to assigned versions of themselves, and lots of tests broke.

  I think to be done properly it needs to be done at a lower level.

Barry




More information about the R-help mailing list