Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup R alert when long process is Finished

Tags:

r

rstudio

alert

I'm running a really long process and it would be great if there was a way to get R to Call, Email or Text me when its finished. Is there a way to setup an R-email script to be run when a program terminates or perhaps something that might employ IFTTT to send me a text message or Call in case I'm sleeping.

I'm using RStudio as my IDE so maybe there is such a feature through there.

If there is a way to track progress that would be nice too, but not 100% required

like image 775
Adam Avatar asked Jul 13 '16 21:07

Adam


1 Answers

From this article:

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("[email protected]", subject="Notification from R", message="Conditions finished running!", password="rmail")

You can then use IFTT triggered by the email.

If you're sleeping next to your computer, consider also: Is there a way to make R beep/play a sound at the end of a script?

like image 73
C8H10N4O2 Avatar answered Sep 20 '22 16:09

C8H10N4O2