Announcing pingr: The R Package that Sounds as it is Called

January 26, 2014

(This article was first published on Publishable Stuff, and kindly contributed to R-bloggers)

pingr is an R package that contains one function, ping(), with one purpose: To go ping on whatever platform you are on (thanks to the audio package). It is intended to be useful, for example, if you are running a long analysis in the background and want to know when it is ready. It’s also useful if you want to irritate colleagues. You could, for example, use ping() to get notified when your package updates have finished:

update.packages(ask=FALSE); ping()

ping() does not only go ping but lets you choose nine different sounds specified by a number (ping(3)) or a name (ping("fanfare")). Bonus points if you can identify where sound two to nine comes from!


pingr is currently residing on GitHub and is never going to be on CRAN, instead grab Hadley Wickham’s devtools and install pingr directly from GitHub by entering this into an R console:

install_github("pingr", "rasmusab")

If you’re on Linux pingr relies on you having the vlc media player installed and on the PATH. If you are on Debian/Ubuntu you can get vlc by running the following in a terminal:

sudo apt-get install vlc

Why pingr?

So occasionally I’m running a Bayesian analysis that takes a couple of minutes. But instead of wasting my time looking at a progress bar the following often happens:

Cat 1

…and this:

Cat 2

…and this:

Cat 3

… and so on. Uncountable cat gifs later I’ve wasted one hour “waiting” on a five minute analysis (more cat gifs here btw, but don’t say I didn’t warn you…). Oh, the hours I would save if I just easily could make R go ping when the analysis is finished, ergo pingr.

A supposedly quick way of getting R to make a sound is using the built in alarm() function. But on my setup, and others I’ve tried, that doesn’t work. pingr should be cross platform as it relies on the audio package on Windows and Mac and on VLC on Linux. I’ve tested it on Ubuntu 12.04, Windows 7 and OS X 10.6 but if it doesn’t work for you tell me and I might be able to sort it out.

To leave a comment for the author, please follow the link and comment on his blog: Publishable Stuff. offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.