gpt4 book ai didi

r - 当长流程完成时设置 R 警报

转载 作者:行者123 更新时间:2023-12-02 05:35:36 25 4
gpt4 key购买 nike

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

我使用 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?

关于r - 当长流程完成时设置 R 警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38361892/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com