问题
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?
回答1:
You want addTaskCallback.
addTaskCallback(function(...) { system("say done"); TRUE }, name = "announce when done")
Have fun!
来源:https://stackoverflow.com/questions/40374302/make-r-rstudio-beep-play-after-every-command