Skip to content
Prev 387694 / 398502 Next

How can certain variables be automatically excluded from being saved?

On 01/04/2021 4:05 a.m., Ralf Goertz wrote:
Jim suggested a way to do that, but I don't think it's really a good 
idea:  it just fixes one aspect of the problem, it doesn't solve the 
whole thing.

The real problem is saving the workspace occasionally, but always 
loading it.  The "always loading" part is automatic, so I think the real 
solution should address the "occasionally saving" part.

If you always save the workspace, things are fine.  You'll save the seed 
at the end of one session, and load it at the beginning of the next.

If you never save the workspace, things are also fine.  You'll always 
generate a new seed in each session that needs one.

Personally, I believe in the "never save it" workflow.  I think it has 
lots of benefits besides the random seed issue:  you won't get a 
more-and-more cluttered workspace over time, you end up with more 
reproducible results, etc.  However, I can understand that some people 
use a different workflow, so "always save it" is sometimes a reasonable 
choice.

So the real problem is the "sometimes save it" workflow, which is 
**encouraged** by the default q(save = "default") option, which asks 
when interactive.  Changing the default to act like q(save = "no") would 
be my preference (and that's how I configure things), but changing it to 
act like q(save = "yes") would be an improvement over the current choice.

Duncan Murdoch