R pkg Easter Eggs -- Revenge of Pacman!

Steve Simpson bio photo By Steve Simpson

In my last post, I praised the virtues of pacman. I also wanted to indulge of one of the main benefits of working with one of pacman’s devs: Tyler Rinker.

Tyler is a geek’s geek, in the best possible way. And one of the best officemates one could ask for to boot! As evidence of that, I thought I’d share a bit of the R-dev goodness that Tyler infused into his pacman package. The fun is a sign of the quality.

Test out this bit of code to find one of the coolest easter eggs in R language.

if (!require("pacman")) install.packages("pacman")

There are several other easter eggs in R listed on Inside-r.org; a few are copied below for your fun:

# install and/or load dependencies for the easter eggs
pacman::p_load(animation, rgdal, PBSmodelling, onion, mapview)

Easter Eggs in Help Pages

A funny note about the locatoin data quality pops up in this help page and gives some pretty good advice regarding air travel.


Fair warning regarding the dangers of playing with internals.


Console Easter Eggs

These are a bit of wRy console humor:


example(readline)  # type n as input

Another easter egg viz, of sorts

  oldpar = par(no.readonly=TRUE)
  x=rnorm(5000,10,3); y=-x+rnorm(5000,1,4); z=x+rnorm(5000,1,3)
  for (i in 1:3)
             pause("Here are the eggs...(Press Enter for next)")},
             pause("Here are the rings...(Press Enter for next)")},
             cat("Here is the pepper alone.\n")} )

data(bunny); p3d(bunny,theta=3,phi=104,box=FALSE)


masthead image altered from screenshot of original pacman imulator