[R] How can certain variables be automatically excluded from being saved?

Ralf Goertz r_goertz @end|ng |rom web@de
Thu Apr 1 10:05:04 CEST 2021


Hi,

after having read here about the "seed problem" I wonder if there is a
way to automatically exclude certain variables from being saved when the
workspace image is saved at the end of an interactive session. I have
been using .First() and .Last() for ages but apparently they are of no
help as .First() gets called before loading the workspace and .Last()
after it has been saved. At least the line

if (".Random.seed" %in% ls(all.names=T)) rm(.Random.seed, pos=1)

in either of those functions doesn't have the desired effect.



More information about the R-help mailing list