pkg <- read.dcf(here::here("DESCRIPTION"), fields = "Package")[1]
description <- read.dcf(here::here("DESCRIPTION"), fields = "Description")[1]

# If you're using R<4.1.1, need this version of rvcheck
# devtools::install_version('rvcheck',version='0.1.8') 
library(hexSticker)
library(dplyr)
library(ggplot2)
library(ggimage)
# library(ggpattern)# remotes::install_github("coolbutuseless/ggpattern")

You can make awesome hex stickers for your R packages using:

r pkg

File path

Create file path to save hex sticker to.

filename <- here::here("inst/hex/hex.png")
dir.create(dirname(filename), showWarnings = FALSE, recursive = TRUE)

hexSticker

s_size = .85
stick <- hexSticker::sticker( 
  subplot = here::here("inst/hex/genetic_scale.png"),
  #### Package name ####
  package = pkg, p_size=18, p_y = 1.5,
  #### Subplot #####
  s_x=1, s_y=.965,  s_height = s_size, s_width = s_size,
  #### Fill & border ####
  h_fill = "#07273f", h_color = "#007c7c", h_size = 2,
  #### Spotlight ####
  spotlight = TRUE, l_alpha = .3, l_width = 5,
  #### File output ####
  filename = filename, dpi = 300)
print(stick)

Session Info

utils::sessionInfo()



serachoi1230/EpiCompare documentation built on Jan. 30, 2024, 11:37 a.m.