[Rd] On implementing zero-overhead code reuse
Kynn Jones
kynnjo at gmail.com
Tue Oct 4 01:24:52 CEST 2016
Martin, thanks for that example. It's definitely eye-opening, and
very good to know.
The installation business, however, is still a killer for me. Of
course, it's a trivial step in a simple example like the one you
showed. But consider this scenario: suppose I perform an analysis
that I may publish in the future, so I commit the project's state at
the time of the analysis, and tag the commit with the KEEPER tag.
Several months later, I want to repeat that exact analysis for some
whatever reason. If the code for the analysis was in Python (say),
all I need to do is this (at the Unix command line):
% git checkout KEEPER
% python src/python/go_to_town.py
...knowing that the `git checkout KEEPER` command, *all by itself*,
has put the working directory in the state I want it to be before I
re-do the analysis.
AFAICT, if the code for the analysis was in R, then `git checkout`, by
itself, would *not* put the working directory in the desired state. I
still need to re-install all the R libraries in the repo. And I
better not forget to do this re-installation, otherwise I will end up
running code different from the one I thought I was running. (I find
this prospect horrifying, for some reason.)
A similar need to re-install stuff would arise whenever I update the repo.
Please correct me if I'm wrong.
More information about the R-devel
mailing list