A ggplot2
and gganimate
Version of Pac-Man
The goal of ggpacman
is to … Build a GIF of the game Pac-Man (not to
develop an R version of Pac-Man …).
Installation
# Install ggpacman from CRAN:
install.packages("ggpacman")
# Or the the development version from GitHub:
# install.packages("remotes")
remotes::install_github("mcanouil/ggpacman")
Pac-Man in action
library(ggpacman)
animate_pacman(
pacman = pacman,
ghosts = list(blinky, pinky, inky, clyde),
font_family = "xkcd"
)
The Story of ggpacman
It started on a Saturday evening …
It was the 21st of March (for the sake of precision),
around 10 pm CET (also for the sake of precision and mostly because it
is not relevant). I was playing around with my data on ‘all’ the movies
I have seen so far
(mcanouil/IMDbRating) and
looking on possibly new ideas of visualisation on twitter using
#ggplot2
and #gganimate
(by the way the first time I played with
gganimate
was at useR-2018 (Brisbane,
Australia), just
before and when @thomasp85 released the actual framework). The only
thing on the feed was “contaminated/deaths and covid-19” curves made
with ggplot2
and a few with
gganimate
… Let’s say, it was not as funny
and interesting as I was hoping for … Then, I’ve got an idea, what if I
can do something funny and not expected with
ggplot2
and
gganimate
? My first thought, was let’s draw
and animate Pac-Man, that should not be that hard!
Well, it was not that easy after-all … But, I am going to go through my code here (you might be interested to actually look at the commits history.
Maybe I went too far with #ggplot2 and #gganimate …