I’m currently in that strange liminality of the dissertation stage of grad school, which means I spend a lot of hours in a little closet in the library cursing quietly. The work is going well—I have little basis to complain—but occasionally I hit some snag with a program I’m writing. For me these headaches seems to happen more frequently in R, leading to events like the following:
I do this frequently enough to have created a bash alias:
But I got to thinking yesterday that a more fruitful approach than advising a hiatus would be a temporary distraction. I decided to write an R function that would show a picture of a puppy and an inspirational quote. Sadly I could not find free APIs that served puppy pictures or inspirational quotes. I settled for cats and quotes from the Dune novels. Now if I feel frustrated, I can call plot.kitty() and get something like these:
You can see the function (which was written sloppily in the span of about 20 minutes) at this GitHub Gist.