我正在运行一个非常漫长的过程,如果有一种方法可以在完成后将R转接到电话,电子邮件或发短信,那将会非常棒。是否有办法设置一个R-email脚本在程序终止时运行,或者可能使用IFTTT向我发送短信或呼叫,以防我正在睡觉。
我正在使用RStudio作为我的IDE,所以也许那里有这样的功能。
如果有办法跟踪进度也不错,但不是100%要求
答案 0 :(得分:5)
从这篇文章:
http://alicebrawley.com/getting-r-to-notify-you-when-its-finished/
我的一般解决方案是结合林书写的R包邮件 Himmelmann,以及IFTTT(如果这个,然后那个)配方的变化。一世 使用邮件使用R中的函数发送电子邮件,然后通知IFTTT 我立刻发了一封特定的电子邮件。
安装邮件后,请使用以下功能发送邮件 代码完成后,您自己收到一封电子邮件。
#Have R email you when it's done running.
###Calculating - your wish is R's command.
library(mail)
#Send yourself an email - specify your preferred email address, subject, and message. The password is fixed at "rmail".
sendmail("xxxxx@xxxxx.com", subject="Notification from R", message="Conditions finished running!", password="rmail")
然后您可以使用电子邮件触发的IFTT。
如果您在计算机旁边睡觉,请同时考虑:Is there a way to make R beep/play a sound at the end of a script?