如何通过R脚本向自己发送数据?

时间:2021-05-03 07:12:47

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?

我如何通过电子邮件发送自己的.rdata文件?

difficulty: The ideal solution will not involve RCurl since I am unable to install that package on my machine instance.

难度:理想的解决方案不涉及RCurl,因为我无法在我的机器实例上安装该软件包。

3 个解决方案

#1


8  

The same way you would on the command-line -- I like the mpack binary for that which you find in Debian and Ubuntu.

就像在命令行上一样 - 我喜欢你在Debian和Ubuntu中找到的mpack二进制文件。

So save data to a file /tmp/foo.RData (or generate a temporary name) and then

因此,将数据保存到文件/tmp/foo.RData(或生成临时名称)然后

 system("mpack -s Data /tmp/foo.RData you@some.where.com")

in R. That assumes the EC2 instance has mail setup, of course.

在R.这假定EC2实例有邮件设置,当然。

Edit Per request for a windoze alternative: blat has been recommended by other for this task.

编辑每个windoze替代品的请求:blat已被其他人推荐用于此任务。

#2


2  

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.

在2007年的R News中有一篇很好的文章。除此之外,作者描述了一些在发生错误时捕获错误的策略,并在发生错误时自动发送电子邮件警报 - 有助于长时间的模拟。

Off topic: the article also gives tips about how the linux/unix tools screen and make 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.

非主题:本文还提供了有关linux / unix工具屏幕和make如何对远程监控和自动错误报告非常有用的提示。如果您愿意让R给您发电子邮件,这些也可能相关。

#3


0  

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

你问的问题最好不是通过电子邮件解决,而是通过使用EBS卷。无论实例如何,卷都将保持不变(请注意,我指的是EBS卷而不是EBS支持的实例)。

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.

在另一个问题中,如果您想在处理过程中使用单独的函数存储数据,我会提到一组检查点和相关工具的选项。

#1


8  

The same way you would on the command-line -- I like the mpack binary for that which you find in Debian and Ubuntu.

就像在命令行上一样 - 我喜欢你在Debian和Ubuntu中找到的mpack二进制文件。

So save data to a file /tmp/foo.RData (or generate a temporary name) and then

因此,将数据保存到文件/tmp/foo.RData(或生成临时名称)然后

 system("mpack -s Data /tmp/foo.RData you@some.where.com")

in R. That assumes the EC2 instance has mail setup, of course.

在R.这假定EC2实例有邮件设置,当然。

Edit Per request for a windoze alternative: blat has been recommended by other for this task.

编辑每个windoze替代品的请求:blat已被其他人推荐用于此任务。

#2


2  

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.

在2007年的R News中有一篇很好的文章。除此之外,作者描述了一些在发生错误时捕获错误的策略,并在发生错误时自动发送电子邮件警报 - 有助于长时间的模拟。

Off topic: the article also gives tips about how the linux/unix tools screen and make 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.

非主题:本文还提供了有关linux / unix工具屏幕和make如何对远程监控和自动错误报告非常有用的提示。如果您愿意让R给您发电子邮件,这些也可能相关。

#3


0  

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

你问的问题最好不是通过电子邮件解决,而是通过使用EBS卷。无论实例如何,卷都将保持不变(请注意,我指的是EBS卷而不是EBS支持的实例)。

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.

在另一个问题中,如果您想在处理过程中使用单独的函数存储数据,我会提到一组检查点和相关工具的选项。