A .RData file be loaded when R/Rscript is started, unless --no-restore-data (or --vanilla) is given. Using startup::startup(), it would be possible to have this as an argument, which could default to an env variable R_STARTUP_RDATA, to control how to handle such .RData files. One could:
R_STARTUP_RDATA=default: Handle it as default (as now)
R_STARTUP_RDATA=rename: Automatically rename it so it's not loaded (emulate a permanent --no-restore-data), e.g. .RData -> .RData.20171212.
R_STARTUP_RDATA=remove: Automatically remove it, because you think they're always bad and only there because of a mistakes.
R_STARTUP_RDATA=prompt: Prompt the user whether they wish to load .RData or not? (Is it ok to prompt user at startup?)
Not sure if this is a good idea or needed, but it's possible because:
0.000s: System information:
0.001s: - R call: /usr/lib/R/bin/exec/R
0.001s: - Current directory: ‘/home/hb’
0.001s: - User's home directory (‘~’): ‘/home/hb’
0.002s: The following has already been processed by R:
0.002s: - ‘/usr/lib/R/etc/Renviron’ (21 lines; 1852 bytes)
0.003s: - ‘/usr/lib/R/etc/Renviron.site’ (0 lines; 934 bytes)
0.003s: - ‘/usr/lib/R/etc/Rprofile.site’ (0 code lines; 819 bytes)
0.004s: - ‘.Rprofile’ (2 code lines; 375 bytes)
0.004s: startup::startup()-specific processing ...
[...]
0.337s: - unloading the 'startup' package
0.338s: startup::startup()-specific processing ... done
0.338s: The following will be processed next by R:
0.338s: - './.RData' (binary file; 24600 bytes)
0.339s: - './.Rhistory' (501 lines; 14060 bytes)
[Previously saved workspace restored]
A
.RData
file be loaded when R/Rscript is started, unless--no-restore-data
(or--vanilla
) is given. Usingstartup::startup()
, it would be possible to have this as an argument, which could default to an env variableR_STARTUP_RDATA
, to control how to handle such.RData
files. One could:R_STARTUP_RDATA=default
: Handle it as default (as now)R_STARTUP_RDATA=rename
: Automatically rename it so it's not loaded (emulate a permanent--no-restore-data
), e.g..RData
->.RData.20171212
.R_STARTUP_RDATA=remove
: Automatically remove it, because you think they're always bad and only there because of a mistakes.R_STARTUP_RDATA=prompt
: Prompt the user whether they wish to load.RData
or not? (Is it ok to prompt user at startup?)Not sure if this is a good idea or needed, but it's possible because: