我不希望我的全局环境在退出时在R中清除 [英] I do NOT want my global environment to clear in R on exit

查看:345
本文介绍了我不希望我的全局环境在退出时在R中清除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使我在Google搜索中指出"NOT",实际上也没有结果.每个人都想清除自己的全球环境.

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

我只是从R开始,所以我想保留所有数据和变量,以便可以玩耍.每次我退出R时,它都会清除全局环境,除非将图像保存到工作空间.RData文件中.

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?

推荐答案

如果使用RStudio,则可以将选项全局选项"->在退出时将工作空间另存为.RData"设置为始终",然后该环境将自动保存并在您下次打开同一项目时加载.

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,保存到RData文件是跨会话保存环境状态"的最简单方法.顺便说一句,如果您不想将对象保存在某处,那么以后如何能够检索它们呢?

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 ?

这篇关于我不希望我的全局环境在退出时在R中清除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆