I do NOT want my global environment to clear in R on exit

核能气质少年 提交于 2020-04-07 05:21:30

问题


Even if I indicate "NOT" in a Google search, there is literally no result for this. Everybody wants to clear their global environment.

I am just starting with R so I want to keep all my data and variables so I can play around. Every time I exit R it clears the global environment unless I save the image to a work space .RData file.

How can I keep all my environment intact without have to save twice every time?


回答1:


If you use RStudio, you can just set the option "Global Options" --> "Save workspace as .RData on exit" to "Always", and the environment will be saved automatically and loaded the next time you open the same project.

AFAIK, saving to a RData file is the easiest way to save the "state" of your environment across sessions. Incidentally, if you do not want to save your objects somewhere, how can you expect to be able to retrieve them afterwards ?



来源:https://stackoverflow.com/questions/45908630/i-do-not-want-my-global-environment-to-clear-in-r-on-exit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!