Make R/RStudio beep play after *every* command

╄→гoц情女王★ 提交于 2020-06-27 10:18:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!