Automatically save history but not data

Viewed 48

I want R (under linux) to behave just like bash, i.e. to automatically load and save history at the beginning and end of session. I don't want to save any data, and I don't want any questions to be asked around it.

How to do this?

R seems to have a lot of options around this, see man R:

   --save Do save workspace at the end of the session

   --no-save
          Don't save it

   --restore
          Do restore previously saved objects at startup

   --no-restore-data
          Don't restore previously saved objects

   --no-restore-history
          Don't restore the R history file

   --no-restore
          Don't restore anything

   --vanilla
          Combine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ

there are options --save and --no-save, but these are about "workspace", which perhaps means "history AND data" together?? Am I understanding it correctly? Perhaps something like --no-save-data option is missing?

I know everything can be probably coded in the .Rprofile... but it's much more robust to achieve it just by calling R with proper options and/or environment variable setups. Correct answer should address this first, and only propose custom workarounds in .Rprofile when no other way is possible. Thanks!

0 Answers
Related