Mar. 4th, 2010

gusl: (Default)
I have one big piece of R code for my research (distributed in several files that source each other). I'm currently deciding how many pieces to break it into.


Advantages of breaking into a lot of pieces (big shell script):

* if there is an error halfway down the program, at least some data has been recorded and it's straightforward to continue from there (BUT this can be done from R too...)

* it may be easier to reproduce results and debug things, without needing to control the random seed / other potential sources of variability (BUT this can be done from R too...)

* frequent garbage collection (but is this really a concern? probably not!)


Advantages of keeping it all in one R process:

* if I run programs from the shell, the same R libraries have to be loaded again and again.

* if I ever use a real IDE (e.g. Eclipse), it might follow function calls to function definitions.



I'm tempted to just write an "R script" that looks a lot like a shell script... maybe call forgetEverything() every other line, and having each called function remember what they need to remember, for the sake of showing that the program is not cheating. (Again, is this a real concern?)

forgetEverything is (rm(list=ls()).

February 2020

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags