sticker/sticker.R

### install package 'hexSticker'
#remotes::install_github("GuangchuangYu/hexSticker")

## Loading Google fonts (http://www.google.com/fonts)
library(showtext)
font_add_google("Inconsolata", "incon")

### create sticker
hexSticker::sticker(
  # Subplot (image)
  subplot = "sticker/graphic.png",
  s_y = 0.15,                          # Position of the sub plot (y)
  s_x = 1,                       # Position of the sub plot (x)
  s_width = 1.1,                    # Width of the sub plot
  s_height = 0.9,                   # Height of the sub plot
  # Font
  package = "personfiles",
  p_size = 22,                      # Font size of the text
  p_y = 1.45,                        # Position of the font (y)
  p_x = 1,                        # Position of the font (x)
  p_color = "#151515",
  # Spotlight
  spotlight = TRUE,                 # Enables spotlight
  l_y = 1.3,                        # Position of spotlight (y)
  l_x = 1.3,                        # Position of spotlight (x)
  # Sticker colors
  h_fill = "#F9DEC9",               # Color for background
  h_color = "#151515",              # Color for border
  # Save
  white_around_sticker=TRUE,        # Puts white triangles in the corners
  filename="man/figures/logo.png"   # Sets file name and location where to store the sticker
)
loelschlaeger/personfiles documentation built on Dec. 21, 2021, 11:45 a.m.