Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make R/RStudio beep play after *every* command

Tags:

r

rstudio

My question relates to making R beep after a command. I understand that I can run beep() together with whatever command I want to run, but is there a way to automatically run beep() (from beepr package) or system("say done") (I run RStudio on a Mac) after every command?

e.g. is there a options() setting I can tweak so that after entering every command in the interpreter another command like beep() is executed?

like image 723
hongsy Avatar asked Mar 10 '23 18:03

hongsy


1 Answers

You want addTaskCallback.

addTaskCallback(function(...) { system("say done"); TRUE }, name = "announce when done")

Have fun!

like image 194
Jonathan Avatar answered Mar 21 '23 05:03

Jonathan