inst/logo.R

library(dplyr)
library(ggplot2)
library(hexSticker)

p <- 
  iris %>% 
  mutate(id = factor(1:n())) %>% 
  ggplot(aes(Sepal.Length, Sepal.Width)) +
  geom_point(aes(col = id), show.legend = FALSE, size = 0.5) +
  geom_smooth(col = '#BB133E', size = 0.25) +
  theme_void() +
  theme_transparent()

p

sticker(
  p, 
  package = "CHL5202",
  p_size = 8,
  p_family = 'serif',
  p_color = "#FFFFFF",
  h_fill = "#00204E",
  h_color = "#BB133E",
  h_size = 1,
  dpi = 320,
  s_x = 1, s_y = 0.75, s_width = 1.5, s_height = 1,
  filename = here::here('logo.png')
  )
mattwarkentin/CHL5202 documentation built on March 1, 2020, 2:28 a.m.