R pkg Easter Eggs — Revenge of Pacman!

[This article was first published on data_steve, 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.

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

To leave a comment for the author, please follow the link and comment on their blog: data_steve.

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)