3

After reading this question I attempted to clean out my workspace and found that each time I opened R all the original items I had recently removed were restored. I then checked .RData and found that it had not been modified in a few weeks even though I repeatedly saved the workspace image. How often is .RData updated and how can I change when .RData is updated so that it reflects more recent changes?

Community
  • 1
  • 1
Stedy
  • 7,359
  • 14
  • 57
  • 77
  • Most of the time, you'll be better off saving your code rather than saving the objects. Your analyses will be more transparent this way (since it isn't always obvious how a variable came to exist, and it may not mean what you think it means, six months down the line.) The only exception is when a variable is the result of an analysis that took a long time to run, so it isn't practical to repeatedly execute your code. – Richie Cotton May 14 '10 at 13:28

1 Answers1

6

It gets modified if and when you

  1. use save.image()
  2. use q() and answer yes

Otherwise it does not get changed.

My personal preference is to explicitly load and save data I want to cache across sessions or for further analysis.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725