长进程完成时设置 R 警报

Setup R alert when long process is Finished

我正在 运行 进行一个非常漫长的过程,如果有一种方法可以让 R 在完成后给我打电话、发电子邮件或发短信给我,那就太好了。有没有一种方法可以在程序终止时将 R-email 脚本设置为 运行,或者可能会使用 IFTTT 向我发送短信或在我睡觉时打电话。

我正在使用 RStudio 作为我的 IDE 所以也许那里有这样的功能。

如果有一种跟踪进度的方法也很好,但不是 100% 需要

来自这篇文章:

http://alicebrawley.com/getting-r-to-notify-you-when-its-finished/

My general solution is to combine the R package mail, written by Lin Himmelmann, and variations on an IFTTT (If This, Then That) recipe. I use mail to send an email using functions in R, then IFTTT to notify me immediately of that particular email.

Once you’ve installed mail, use the following functions to send yourself an email when your code is completed.

#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?