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

[This article was first published on Publishable Stuff, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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!

Installation

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.packages("devtools")
library(devtools)
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 their blog: Publishable Stuff.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)