Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startup(): Add argument and env var to (always) skip .RData #42

Closed
HenrikBengtsson opened this issue Dec 13, 2017 · 1 comment
Closed
Labels
Milestone

Comments

@HenrikBengtsson
Copy link
Owner

HenrikBengtsson commented Dec 13, 2017

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:

  1. R_STARTUP_RDATA=default: Handle it as default (as now)
  2. R_STARTUP_RDATA=rename: Automatically rename it so it's not loaded (emulate a permanent --no-restore-data), e.g. .RData -> .RData.20171212.
  3. R_STARTUP_RDATA=remove: Automatically remove it, because you think they're always bad and only there because of a mistakes.
  4. 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/hb0.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]
@HenrikBengtsson
Copy link
Owner Author

HenrikBengtsson commented Apr 3, 2018

Maybe add an option to prompt the user whether they wish to load .RData or not? (Is it ok to prompt user at startup?)

Examples:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant