如何通过 R 脚本向自己发送数据?
我希望利用亚马逊现货实例,它的成本较低,但可以随时终止。我想对其进行设置,以便我可以通过脚本中途向自己发送数据,以便将来可以从那里获取数据。
我如何通过电子邮件给自己发送 .rdata 文件?
困难:理想的解决方案不会涉及 RCurl,因为我无法在我的计算机实例上安装该包。
I'm hoping to take advantage of Amazon spot instances which come at a lower cost but can terminate anytime. I want to set it up such that I can send myself data mid-way through a script so I can pick up from there in the future.
How would I email myself a .rdata file?
difficulty: The ideal solution will not involve RCurl since I am unable to install that package on my machine instance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2007 年的 R News 中有一篇关于此的好文章。除其他外,作者描述了一些在错误发生时捕获错误的策略,并在发生错误时自动发送电子邮件警报——这对于长时间的模拟很有帮助。
题外话:本文还提供了有关 linux/unix 工具
screen
和make
如何对远程监控和自动错误报告非常有用的提示。当您愿意让 R 向您发送电子邮件时,这些也可能相关。There is a good article on this in R News from 2007. Amongst other things, the author describes some tactics for catching errors as they occur, and automatically sending email alerts when this happens -- helpful for long simulations.
Off topic: the article also gives tips about how the linux/unix tools
screen
andmake
can be very useful for remote monitoring and automatic error reporting. These may also be relevant in cases when you are willing to let R email you.您所问的问题可能最好不是通过电子邮件来解决,而是通过使用 EBS 卷来解决。无论实例如何,该卷都将持续存在(请注意,我指的是 EBS 卷,而不是 EBS 支持的实例)。
在另一个问题中,我提到了一系列检查点和相关选项工具,如果您想在处理过程中使用单独的功能来存储数据。
What you're asking is probably best solved not by email but by using an EBS volume. The volume will persist regardless of the instance (note though that I'm referring to an EBS volume as opposed to an EBS-backed instance).
In another question, I mention a bunch of options for checkpointing and related tools, if you would like to use a separate function for storing your data during the processing.
就像在命令行上一样——我喜欢 Debian 和 Ubuntu 中的
mpack
二进制文件。因此,将数据保存到文件
/tmp/foo.RData
(或生成临时名称),然后保存在 R 中。当然,这是假设 EC2 实例具有邮件设置。
编辑根据对windoze替代方案的请求:blat已被其他人推荐用于此任务。
The same way you would on the command-line -- I like the
mpack
binary for that which you find in Debian and Ubuntu.So save data to a file
/tmp/foo.RData
(or generate a temporary name) and thenin R. That assumes the EC2 instance has mail setup, of course.
Edit Per request for a windoze alternative: blat has been recommended by other for this task.