Package

ggameboy

Author

Tobias Stalder

Basic game boy

Default game boy

By default, the gameboy_plot function of the package creates a dark gray game boy.

# install.packages("devtools")
# devtools::install_github("toebR/ggameboy")
library(ggameboy)

gameboy_plot()

The ggameboy package in R

Game boy customization

Draw a game boy in R ggplot2

Arguments

You can customize every single color of the game boy, even the text displayed on the screen. The following is a cheat sheet created by the author summarizing all the arguments that can be customized.

gameboy_plot function

Color and screen text

For instance, if you want your game boy in gold with a custom text you can type the following:

# install.packages("devtools")
# devtools::install_github("toebR/ggameboy")
library(ggameboy)

gameboy_plot(background = "white",
             case = "gold",
             screentext = "Pokemon Gold") 

Draw a game boy in R ggplot2

Adding more layers

In addition, it is possible to add more ggplot layers to the original plot, such as a title or a caption with ggtitle or labs, for instance. You can also modify these new layers with the theme function components.

# install.packages("devtools")
# devtools::install_github("toebR/ggameboy")
# install.packages("ggplot2")
library(ggameboy)
library(ggplot2)

gameboy_plot(background = "white",
             case = "#C0C0C0",
             screentext = "Pokemon Silver")  +
  ggtitle("Silver Game Boy") + 
  labs(caption = "Made with ggameboy") + 
  theme(plot.title = element_text(hjust = 0.5))

See also