A ggplot2 geom for adding Bernie Sanders. This is a core package of the memeverse. Check also ggcats.
This is a package inspired by a tweet by @samuelmehr
- Visit my R programming site
# install.packages("remotes")
remotes::install_github("R-CoderDotCom/ggbernie@main")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "sitting")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "stand")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "head")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "young")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "arms")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "eyebrows")
ggplot(mtcars) +
geom_bernie(aes(mpg, wt), bernie = "asking")
library(ggplot2)
plane <- "https://user-images.githubusercontent.com/67192157/105575266-b173b980-5d6a-11eb-90e3-a7ddea0fe52b.png"
data <- data.frame(x = c(-0.1, 0, 0.05, 0.1, 0.15, 0.2,
0.3, 0.35, 0.4, 0.43, 0.52, 0.56, 0.6, 0.65,
0.3, 0.35, 0.38, 0.42, 0.5, 0.46, 0.44, 0.5, 0.51, 0.45, 0.6, 0.56, 0.63,
0.8, 0.85, 0.9, 0.75, 0.95),
y = c(0.61, 0.6, 0.65, 0.62, 0.67, 0.61,
0, 0.05, 0.02, 0.01, 0.033, 0.021, 0, 0.018,
0.65, 0.55, 0.6, 0.53, 0.42, 0.48, 0.43, 0.54, 0.6, 0.58, 0.55, 0.57, 0.65,
0.62, 0.64, 0.625, 0.67, 0.665))
p <- ggplot(data, aes(x, y)) +
geom_bernie(bernie = "sitting") +
xlim(c(0, 1)) +
ylim(c(0, 1)) +
theme(panel.grid = element_line(color = "transparent"),
axis.title = element_text(color = "transparent"),
axis.text = element_text(color = "transparent"),
axis.ticks = element_blank())
library(ggimage)
ggbackground(p, plane)
The draw_key_bernie
function was inspired by draw_key_lime
from geom_lime
.
Not the plot I wanted, but the plot I **needed**. We have a new activity in the office, called plotcrastinating. #aRt #geom_bernie #ggbernie #ggplot2 #Rladies pic.twitter.com/4j6jWo1nEW
— Chloe Fouilloux (@ChloeFouilloux) January 25, 2021
We had to know this was coming @RCoderWeb https://t.co/6H5bQ0yIYa pic.twitter.com/yvT3Lfg5qH
— Jonathan Hersh (@DogmaticPrior) January 25, 2021
— Julius Lehtinen (@Julleht) January 25, 2021
— Travis Gerke (@travisgerke) January 25, 2021
Bernie shows us health inequalities among Chicago Community Areas #rstats pic.twitter.com/IhswP476DG
— hughbartling (@hughbartling) January 24, 2021