且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

RStudio - 如何在崩溃后恢复数据?

更新时间:2023-02-02 17:07:13

我会伸出脖子说你不能.

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).