In that case, I would replace the saveRDS
command in my suggested pre-processing script with save.image(file = "Processed_puppy.Rdata")
, and then load it with load("Processed_puppy.Rdata")
in your analysis script. In that case, you would also want to clear your environment prior to running your pre-processing script, meaning that this is one situation that I would suggest that you should start your script with rm(list = ls())
.
The main point of all of this is that you want your work to be reproducible, even (and often especially) by yourself. If you rely on a constantly updated global environment to track your work, all it takes is one undocumented dat$value <- dat$value - offset
command sent to the console make it very difficult to reproduce your analysis 6 months from now. I speak purely from theory, of course, having never encountered such an absurd situation in my own code.