RStudio - 如何在崩溃后恢复数据? [英] RStudio - how to recover data after crash?

查看:80
本文介绍了RStudio - 如何在崩溃后恢复数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在计算需要两周才能运行的大量数据.当我尝试导出数据以在 MS SQL 中使用时,我的 RStudio 崩溃了,我不得不重新打开它.现在,当我尝试查找数据时,它似乎丢失了!!!哎呀!

Was calculating a massive amount of data that took two weeks to run. When I was trying to export the data to use in MS SQL, my RStudio crashed and I had to reopen it. Now when I try to look for the data it seems to be missing!!! YIKES!

该数据是否位于某个文件中,或者您在该会话中处理的所有数据都消失了?

Is that data sitting in a file somewhere or does all data you were working with in that session disappear?

抱歉我对 R 一无所知.我对它很陌生.

Sorry for my ignorance of R. I'm pretty new to it.

在此先感谢您的帮助.

推荐答案

我会伸出脖子说你不能.

I'm going to stick my neck out and say that you can't.

由于 R 在内存中"执行所有计算,我认为您无法恢复任何内容.R Studio 有一些不错的功能,可以让您恢复正在编辑的脚本,但它不是 R,它的内存中也没有您的数据.归根结底,R Studio 只是 R 应用程序的 IDE/接口,恰好比默认的 R Gui(它也只是 R 的接口)更加用户友好.

Since R performs all calculations "in memory" I don't think you can recover anything. R Studio has some nice features that lets you recover scripts that are being edited, but it's not R and it doesn't your data in its memory. At the end of the day R Studio is just an IDE / interface to the R application, which happens to be even much more user-friendly than the default R Gui (which is also just an interface to R).

在我看来,R 相当稳定,但一些非常有用的包也不太稳定.根据我的经验,RODBC 就是其中之一.我怀疑在许多操作系统和许多数据库中制作可靠的东西是很复杂的.

In my opinion, R is quite stable, but some of the packages that are very useful are also less stable. In my experience, RODBC is one of those. I suspect that it's complicated to make something that's reliable across many operating systems and many databases.

我强烈建议使用 saveRDS 或 save 将任何数据存储为 RDS 或 RData 文件,然后将该数据加载到 R 中,然后在单独的过程中加载到 SQL 中.使用内置函数保存 R 数据应该是非常可靠的.

I would highly recommend storing any data as an RDS or RData file using saveRDS or save, and then loading that data into R and then into SQL in a separate procedure. Saving the R data using the built-in functions should be very reliable.

一般来说,将 R 到 ODBC 的工作分开会使调试更容易.

Generally speaking, keeping the the R to ODBC work separate will make it a lot easier to debug anyway.

很抱歉你在数据恢复方面的运气,我希望重新运行比最初运行更容易(即我希望这不是一个不停计算的一周).

Sorry about your luck with the data recovery, and I hope that it's easier to re-run than it was to run originally (i.e. I hope it wasn't a week of non-stop calculating).

这篇关于RStudio - 如何在崩溃后恢复数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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