/ggdogs

The geom you always wished for adding dogs to ggplot2

Primary LanguageRGNU General Public License v3.0GPL-3.0

ggdogs

The geom you always wished for adding dogs to ggplot2. This package is part of the memeverse. The source code of this package is based on geom_image from ggimage.

What is the memeverse?

A collection of funny packages which can be interesting to create plots to show on a first lesson to new R students in order to motivate them learning the language. The other package of the (small) memeverse are ggcats and ggbernie. Statistics and programming can be fun!

Installation

# install.packages("remotes")
remotes::install_github("R-CoderDotCom/ggdogs@main")

Available dogs

There are 25 dogs available:

"doge" (default) "doge_strong" "chihuahua" "eyes" "gabe" "glasses" "tail" "surprised"
"thisisfine" "hearing" "pug" "ears" "husky" "husky_2" "chilaquil"  "santa", "bryan",
"vinny" "jake" "lucy" "puppie" "goofy" "snoopy" "scooby" "suspicious"

Some examples

grid <- expand.grid(1:5, 5:1)

df <- data.frame(x = grid[, 1],
                 y = grid[, 2],
                 image = c("doge", "doge_strong", "chihuahua", "eyes", "gabe", "glasses", "tail", "surprised",
                           "thisisfine", "hearing", "pug", "ears", "husky", "husky_2", "chilaquil", "santa", "bryan", "vinny", "jake",
                           "lucy", "puppie", "goofy", "snoopy", "scooby", "suspicious"))
                           
library(ggplot2)
library(ggdogs)
ggplot(df) +
 geom_dog(aes(x, y, dog = image), size = 3) +
 geom_label(aes(x, y - 0.25, label = image), size = 4) +
 xlim(c(0.25, 5.5)) + 
 ylim(c(0.25, 5.5))

ggplot(mtcars) +
  geom_dog(aes(mpg, wt), dog = "doge_strong", size = 5)

ggplot(mtcars) +
  geom_dog(aes(mpg, wt, size = cyl), dog = "husky")