notifier包实现了跨平台的桌面提醒功能,当然它是调用了外部的命令,比如windows使用了toaster,老版本windows使用的是notifu,在linux下使用notify-send,而在OSX下,则调用了terminal-notifier,通过了简单的封装之后,就可以给桌面发布消息提醒了。

比如:

library(notifier)
notify(
  title = "15 Packages out of date",
  msg = c("You can run update.packages() to update them.",
  "Outdated packages: Boom colorspace desc memuse networkD3",
  "pbapply revealjs rgl rmdformats timevis and 5 more")
)

​ 效果如下:

Linux Windows 8 or newer

macOS Old Windows

安装只需要:

source("https://install-github.me/gaborcsardi/notifier")

这个包还是很有用的,比如写点简单的脚本,放到系统服务里,可以做监测,有情况就可以给出提醒。