Skip to content

Instantly share code, notes, and snippets.

@ateucher
Last active August 29, 2015 14:20
Show Gist options
  • Save ateucher/f6d52d482876bed868fd to your computer and use it in GitHub Desktop.
Save ateucher/f6d52d482876bed868fd to your computer and use it in GitHub Desktop.
cowsay errors
## Makes a random animal deliver the error message
## Fun to put in a .Rprofile :)
# devtools::install_github("sckott/cowsay")
library("cowsay", quietly = TRUE)
options(error = function() {
animal <- say("", by = "random", type = "string")
## remove the top "-------" message delimiter from the cowsay character
message(strsplit(animal, "\n\\s*-{5,20}\\s*\n\\s*\n")[[1]][2])
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment